diff --git a/src/bin/fdisk/main.c b/src/bin/fdisk/main.c index 4342aab..8ac0f97 100644 --- a/src/bin/fdisk/main.c +++ b/src/bin/fdisk/main.c @@ -29,13 +29,29 @@ #include "ubixfs.h" +struct dos_partition { + unsigned char dp_flag; /* bootstrap flags */ + unsigned char dp_shd; /* starting head */ + unsigned char dp_ssect; /* starting sector */ + unsigned char dp_scyl; /* starting cylinder */ + unsigned char dp_type; /* partition type */ + unsigned char dp_ehd; /* end head */ + unsigned char dp_esect; /* end sector */ + unsigned char dp_ecyl; /* end cylinder */ + uInt32 dp_start; /* absolute starting sector number */ + uInt32 dp_size; /* partition size in sectors */ +}; + int main(int argc,char **argv) { FILE *fd; - struct ubixDiskLabel *d = (struct ubixDiskLabel *)malloc(512); + struct dos_partition *d = 0x0; + char *data = (char *)malloc(512); int i = 0x0; char buf[256]; + d = (struct dos_partition *)(data + 0x1BE); + printf("Ubix Disk Editor Version 1.0\n"); printf("(c) 2004 Ubix Corp \n\n"); @@ -48,41 +64,24 @@ fd = fopen("hd0@devfs","rb"); } fseek(fd,0,0); - fread(d,512,1,fd); + fread(data,512,1,fd); if (argc >= 3) { i = atoi(argv[2]); - printf("d->partitions[%i].p_size = %i, ",i,d->partitions[i].p_size); + printf("d[%i].dp_type = %i, ",i,d[i].dp_type); printf("New Value: "); gets(&buf); - d->partitions[i].p_size = atoi(buf); - printf("d->partitions[%i].p_offset = %i, ",i,d->partitions[i].p_offset); - printf("New Value: "); - gets(&buf); - d->partitions[i].p_offset = atoi(buf); - printf("d->partitions[%i].p_fstype = %i, ",i,d->partitions[i].p_fstype); - printf("New Value: "); - gets(&buf); - d->partitions[i].p_fstype = atoi(buf); - printf("d->partitions[%i].p_bsize = %i, ",i,d->partitions[i].p_bsize); - printf("New Value: "); - gets(&buf); - d->partitions[i].p_bsize = atoi(buf); - printf("\n"); - printf("d->partitions[%i].p_size = %i\n",i,d->partitions[i].p_size); - printf("d->partitions[%i].p_offset = %i\n",i,d->partitions[i].p_offset); - printf("d->partitions[%i].p_fstype = %i\n",i,d->partitions[i].p_fstype); - printf("d->partitions[%i].p_bsize = %i\n",i,d->partitions[i].p_bsize); + d[i].dp_type = atoi(buf); + printf("d[%i].dp_type: 0x%X\n",i,d[i].dp_type); fseek(fd,0,0); - fwrite(d,512,1,fd); + fwrite(data,512,1,fd); } else { for (i=0;i<4;i++) { - if (d->partitions[i].p_fstype != 0x0) { - printf("d->partitions[%i].p_size = %i\n",i,d->partitions[i].p_size); - printf("d->partitions[%i].p_offset = %i\n",i,d->partitions[i].p_offset); - printf("d->partitions[%i].p_fstype = 0x%X\n",i,d->partitions[i].p_fstype); - printf("d->partitions[%i].p_bsize = 0x%X\n",i,d->partitions[i].p_bsize); + if (d[i].dp_type != 0x0) { + printf("d[%i].dp_type: 0x%X\n",i,d[i].dp_type); + printf("d[%i].dp_start: %i\n",i,d[i].dp_start); + printf("d[%i].dp_size: %i\n",i,d[i].dp_size); } } } diff --git a/src/sys/init/main.c b/src/sys/init/main.c index e816e11..463dc48 100644 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.8 2004/04/28 21:10:40 reddawg + Lots Of changes to make it work with existing os + Revision 1.7 2004/04/26 22:27:36 reddawg Now mounts our harddrive I need to either impliment fstab or do something similar @@ -160,24 +163,24 @@ enableUbixFS(); fdcInit(); initHardDisk(); - /* if (mount(0x0,0x0,0x0,"sys","rw") != 0x0) { kprintf("Problem Mounting sys Mount Point\n"); } if (mount(0x0,0x1,0x0,"tmp","rw") != 0x0) { kprintf("Problem Mounting tmp Mount Point\n"); } - */ + /* if (mount(0x1,0x1,0x0,0x0,"sys","rw") != 0x0) { kprintf("Problem Mounting HD Mount Point\n"); } + */ kprintf("Free Pages: [%i]\n",freePages); kprintf("MemoryMap: [0x%X]\n",vmmMemoryMap); kprintf("Starting Os\n"); - //netInit(); + netInit(); execThread(idleTask,(uInt32)(kmalloc(0x2000,sysID)+0x2000),0x0,"Idle Thread"); - execFile("init@sys",0x0,0x0,0x0); - //execFile("shell@sys",0x0,0x0,0x0); + //execFile("init@sys",0x0,0x0,0x0); + execFile("shell@sys",0x0,0x0,0x0); irqEnable(0x0); sched(); return(0x0); diff --git a/src/sys/isa/fdc.c b/src/sys/isa/fdc.c index a19c2c3..6ae45a9 100644 --- a/src/sys/isa/fdc.c +++ b/src/sys/isa/fdc.c @@ -24,6 +24,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.4 2004/04/28 02:22:54 reddawg + This is a fiarly large commit but we are starting to use new driver model + all around + Revision 1.3 2004/04/26 22:22:33 reddawg DevFS now uses correct size of device @@ -58,7 +62,6 @@ static drvGeom geometry = { dg144Heads,dg144Tracks,dg144Spt }; static bool diskChange = FALSE; static bool motor = FALSE; -static int mTick = 0; static byte fdcTrack = 0xff; static byte sr0 = 0; static volatile int timeOut = 0; @@ -208,16 +211,16 @@ } void motorOn(void) { - if (!motor) { - mTick = -1; /* stop motor kill countdown */ + if (motor == FALSE) { outportByte(fdcDor,0x1c); motor = TRUE; } } void motorOff(void) { - if (motor) { - mTick = 13500; + if (motor == TRUE) { + outportByte(fdcDor,0x1C); + motor = FALSE; } } @@ -290,7 +293,6 @@ void reset(void) { outportByte(fdcDor,0); - mTick = 0; motor = FALSE; outportByte(fdcDor,0x0c); done = TRUE; diff --git a/src/sys/isa/ne2k.c b/src/sys/isa/ne2k.c index b08252e..9c54031 100644 --- a/src/sys/isa/ne2k.c +++ b/src/sys/isa/ne2k.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.4 2004/04/27 21:05:19 reddawg + Updating drivers to use new model + Revision 1.3 2004/04/20 00:53:16 reddawg Works @@ -326,8 +329,6 @@ tmpBuf = ne2kAllocBuffer(length); NICtoPC(dev,tmpBuf->buffer,length,page * DP_PAGESIZE + sizeof(dp_rcvhdr_t)); } - - kprintf("."); return(OK); } diff --git a/src/sys/net/net/Makefile b/src/sys/net/net/Makefile index 9147cf9..2e8bcfa 100644 --- a/src/sys/net/net/Makefile +++ b/src/sys/net/net/Makefile @@ -6,7 +6,7 @@ include ../../Makefile.inc # Objects -OBJS = udpecho.o init.o sys_arch.o shell.o +OBJS = udpecho.o init.o sys_arch.o shell.o bot.o all: $(OBJS) diff --git a/src/sys/net/net/bot.c b/src/sys/net/net/bot.c new file mode 100644 index 0000000..6c8e96a --- /dev/null +++ b/src/sys/net/net/bot.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2001, Swedish Institute of Computer Science. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + * $Id$ + */ + +#include +#include +#include + +#include "net/mem.h" +#include "net/debug.h" +#include "net/def.h" +#include "net/api.h" +#include "net/stats.h" + +static void sendstr(const char *str, struct netconn *conn) { + netconn_write(conn, (void *)str, kstrlen(str), NETCONN_NOCOPY); + } + +static void botErr() { + kprintf("ERRROR\n"); + } + +static void bot_thread(void *arg) { + struct netconn *conn; + int len; + char bufr[1500]; + struct ip_addr ipaddr; + struct netbuf *buf = 0x0; + + IP4_ADDR(&ipaddr,216,152,77,10); + conn = netconn_new(NETCONN_TCP); + kprintf("Starting UbixOS Bot\n"); + while(1) { + netconn_connect(conn,&ipaddr,6667); + if (buf != NULL) { + buf = netconn_recv(conn); + netbuf_copy(buf, bufr, 1024); + len = netbuf_len(buf); + netbuf_delete(buf); + bufr[len-2] = '\0'; + kprintf("Bufr: [%s:%i]",bufr,len); + //sendstr("BLah\n",conn); + } + } + } + +void bot_init(void) { + sys_thread_new(bot_thread, NULL); + } + +/*** + END + ***/ + diff --git a/src/sys/net/net/init.c b/src/sys/net/net/init.c index db98aa8..4d135da 100644 --- a/src/sys/net/net/init.c +++ b/src/sys/net/net/init.c @@ -56,7 +56,8 @@ netif_add(&ipaddr, &netmask, &gw, loopif_init, tcpip_input); //udpecho_init(); - shell_init(); + //shell_init(); + //bot_init(); kprintf("Application Started\n"); diff --git a/src/tools/Makefile b/src/tools/Makefile index 690e258..55cf61c 100644 --- a/src/tools/Makefile +++ b/src/tools/Makefile @@ -48,7 +48,7 @@ (cp ../bin/cp/cp ./) #(cp ../bin/format/format ./) (./format 50 2000 /dev/fd0 ubix.elf 0 format 3754 fdisk 3754 ROM8X14.DPF 3754 init 3754 login 3754 shell 3754 userdb 3754 ls 3754 motd 3754 cp 3754) - (./format 200 2000 /dev/md1 ubix.elf 0 format 3754 fdisk 3754 ROM8X14.DPF 3754 init 3754 login 3754 shell 3754 userdb 3754 ls 3754 motd 3754 cp 3754) + #(./format 200 2000 /dev/md1 ubix.elf 0 format 3754 fdisk 3754 ROM8X14.DPF 3754 init 3754 login 3754 shell 3754 userdb 3754 ls 3754 motd 3754 cp 3754) (./format 1064 2000 /dev/fd0 shell 3754 clock 3754) #(./format 200 2000 /dev/md1 ubix.elf 0 shell 3754 motd 3754 libc.so 3754) (rm -fr ubix.elf)