diff --git a/src/sys/Makefile b/src/sys/Makefile index 0f45e30..d7567f5 100755 --- a/src/sys/Makefile +++ b/src/sys/Makefile @@ -1,7 +1,7 @@ # $Id$ # Kernel Makefile (C) 2002 The UbixOS Project -all: boot-code init-code kernel-code driver-code vmm-code kernel-img +all: boot-code init-code kernel-code driver-code vmm-code ubixfs-code kernel-img boot-code: boot (cd boot;make) @@ -15,8 +15,11 @@ driver-code: drivers (cd drivers;make) -vmm-code :vmm - (cd vmm;make); +vmm-code: vmm + (cd vmm;make) + +ubixfs-code: ubixfs + (cd ubixfs;make); kernel-img: compile (/bin/echo "/* " > ./compile/null.c) @@ -34,3 +37,4 @@ (cd kernel;make clean) (cd compile;make clean) (cd vmm;make clean) + (cd ubixfs;make clean) diff --git a/src/sys/compile/Makefile b/src/sys/compile/Makefile index 7be4db4..050509c 100755 --- a/src/sys/compile/Makefile +++ b/src/sys/compile/Makefile @@ -20,7 +20,7 @@ # Link the kernel statically with fixed text+data address @1M $(KERNEL) : $(OBJS) - $(LD) -o $@ $(OBJS) ../init/*.o ../kernel/*.o ../drivers/*.o ../vmm/*.o -Ttext 0x10000 + $(LD) -o $@ $(OBJS) ../init/*.o ../kernel/*.o ../drivers/*.o ../vmm/*.o ../ubixfs/*.o -Ttext 0x10000 # Compile the source files .cc.o: diff --git a/src/sys/drivers/fdc.c b/src/sys/drivers/fdc.c index 8191038..252f93f 100755 --- a/src/sys/drivers/fdc.c +++ b/src/sys/drivers/fdc.c @@ -34,6 +34,7 @@ void initFloppy() { setVector(floppyIsr, mVec+6, (dInt+dPresent+dDpl1)); enableIrq(6); + reset(); } asm( diff --git a/src/sys/include/ubixfs/ubixfs.h b/src/sys/include/ubixfs/ubixfs.h new file mode 100755 index 0000000..69ef1a1 --- /dev/null +++ b/src/sys/include/ubixfs/ubixfs.h @@ -0,0 +1,34 @@ +/************************************************************************************** + Copyright (c) 2002 The UbixOS Project + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are prohibited. + + $Id$ + +**************************************************************************************/ + +#ifndef _UBIXFS_H +#define _UBIXFS_H + +#include + +struct fileTable { + uChar fileName[24]; + uShort start; + uShort end; + uShort attributes; + uShort reserved; + }; + +struct bootSect { + uChar jmp[4]; + uChar id[6]; + uLong version; + unsigned long fsStart; + }; + +void initUbixFS(); + +#endif \ No newline at end of file diff --git a/src/sys/include/ubixos/types.h b/src/sys/include/ubixos/types.h index 1da4581..bf3623a 100755 --- a/src/sys/include/ubixos/types.h +++ b/src/sys/include/ubixos/types.h @@ -1,8 +1,12 @@ /************************************************************************************** - Copyright (c) 2002 - The UbixOS Project + Copyright (c) 2002 The UbixOS Project + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are prohibited. $Id$ + **************************************************************************************/ #ifndef _TYPES_H @@ -14,6 +18,7 @@ typedef unsigned char uChar; typedef unsigned long uLong; +typedef unsigned short uShort; typedef unsigned int uInt; typedef enum { FALSE=0,TRUE=1 } bool; diff --git a/src/sys/init/main.c b/src/sys/init/main.c index a0b937f..abcae50 100755 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -20,6 +20,7 @@ #include #include #include +#include int main(); @@ -73,8 +74,7 @@ initKeyboard(); //Initialize Keyboard initScheduler(); //Initialize Scheduler initFloppy(); //Initialize Floppy Controller - execThread(idleThread,0xAFFF,"Kernel Idle Thread"); - execThread(test,0xBFFF,"Kernel Test Thread"); - enableIrq(0); + initUbixFS(); +// enableIrq(0); return(0); } \ No newline at end of file diff --git a/src/sys/ubixfs/Makefile b/src/sys/ubixfs/Makefile new file mode 100755 index 0000000..4b84eca --- /dev/null +++ b/src/sys/ubixfs/Makefile @@ -0,0 +1,35 @@ +# (C) 2002 The UbixOS Project +# $Id$ + + +# Compiler +CC = gcc +CPP = g++ + + +# Linker +LINKER = ld + +# Remove +REMOVE = rm -fr + +# Objects +OBJS = ubixfs.o + +all: $(OBJS) + +# Compile Types +.cc.o: + $(CPP) -Wall -fomit-frame-pointer -O -I../include -c -o $@ $< +.cc.s: + $(CPP) -Wall -fomit-frame-pointer -O -I../include -S -o $@ $< +.c.o: + $(CC) -Wall -fomit-frame-pointer -O -I../include -c -o $@ $< +.c.s: + $(CC) -Wall -fomit-frame-pointer -O -I../include -S -o $@ $< +.S.o: + $(CC) -Wall -fomit-frame-pointer -c -o $@ $< + +# Clean up the junk +clean: + $(REMOVE) $(OBJS) diff --git a/src/sys/ubixfs/ubixfs.c b/src/sys/ubixfs/ubixfs.c new file mode 100755 index 0000000..cdc546c --- /dev/null +++ b/src/sys/ubixfs/ubixfs.c @@ -0,0 +1,22 @@ +/************************************************************************************** + Copyright (c) 2002 The UbixOS Project + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are prohibited. + + $Id$ + +**************************************************************************************/ + +#include +#include +#include + +void initUbixFS() { + struct bootSect *bs; + char data[512]; +// readBlock(0,data,1); + bs = data; + kprintf("Test: [%s]\n",bs[0].id); + } \ No newline at end of file diff --git a/ubixos.kdevprj b/ubixos.kdevprj index e398e42..35ceb36 100755 --- a/ubixos.kdevprj +++ b/ubixos.kdevprj @@ -32,7 +32,7 @@ kdevprj_version=1.3 lfv_open_groups=Others make_options=\s-j1 clean all install -makefiles=./Makefile.am,src/Makefile.am,src/sys/Makefile.am,src/sys/include/Makefile.am,src/lib/Makefile.am,src/lib/libc/Makefile.am,src/lib/libc/include/Makefile.am,src/bin/Makefile.am,src/bin/shell/Makefile.am,Makefile.am,src/sys/boot/Makefile.am,src/sys/init/Makefile.am,src/sys/include/ubixos/Makefile.am,src/sys/drivers/Makefile.am,src/sys/kernel/Makefile.am,src/sys/compile/Makefile.am,src/sys/include/version/Makefile.am,src/sys/include/drivers/Makefile.am,src/sys/vmm/Makefile.am,src/sys/include/vmm/Makefile.am +makefiles=./Makefile.am,src/Makefile.am,src/sys/Makefile.am,src/sys/include/Makefile.am,src/lib/Makefile.am,src/lib/libc/Makefile.am,src/lib/libc/include/Makefile.am,src/bin/Makefile.am,src/bin/shell/Makefile.am,Makefile.am,src/sys/boot/Makefile.am,src/sys/init/Makefile.am,src/sys/include/ubixos/Makefile.am,src/sys/drivers/Makefile.am,src/sys/kernel/Makefile.am,src/sys/compile/Makefile.am,src/sys/include/version/Makefile.am,src/sys/include/drivers/Makefile.am,src/sys/vmm/Makefile.am,src/sys/include/vmm/Makefile.am,src/sys/include/ubixfs/Makefile.am,src/sys/ubixfs/Makefile.am modifyMakefiles=true project_name=UbixOS project_type=normal_empty @@ -121,7 +121,7 @@ [src/sys/Makefile.am] files=src/sys/Makefile -sub_dirs=include,boot,init,drivers,kernel,compile,vmm +sub_dirs=include,boot,init,drivers,kernel,compile,vmm,ubixfs type=normal [src/sys/boot/Makefile] @@ -189,7 +189,7 @@ [src/sys/include/Makefile.am] files=src/sys/include/stdarg.h -sub_dirs=ubixos,version,drivers,vmm +sub_dirs=ubixos,version,drivers,vmm,ubixfs type=normal [src/sys/include/drivers/8259.h] @@ -227,6 +227,17 @@ install_location= type=HEADER +[src/sys/include/ubixfs/Makefile.am] +files=src/sys/include/ubixfs/ubixfs.h +sub_dirs= +type=normal + +[src/sys/include/ubixfs/ubixfs.h] +dist=true +install=false +install_location= +type=HEADER + [src/sys/include/ubixos/Makefile.am] files=src/sys/include/ubixos/gdt.h,src/sys/include/ubixos/io.h,src/sys/include/ubixos/idt.h,src/sys/include/ubixos/exec.h,src/sys/include/ubixos/schedule.h,src/sys/include/ubixos/types.h,src/sys/include/ubixos/dma.h,src/sys/include/ubixos/idlethread.h sub_dirs= @@ -392,6 +403,19 @@ install_location= type=SOURCE +[src/sys/ubixfs/Makefile.am] +files=src/sys/ubixfs/ubixfs.c +sharedlib_LDFLAGS=-version-info 0:0:1 +sharedlib_rootname=ubixfs +sub_dirs= +type=static_library + +[src/sys/ubixfs/ubixfs.c] +dist=true +install=false +install_location= +type=SOURCE + [src/sys/vmm/Makefile] dist=true install=false