diff --git a/src/sys/boot/boot2/boot1.s b/src/sys/boot/boot2/boot1.s index 107fb4c..b02879e 100644 --- a/src/sys/boot/boot2/boot1.s +++ b/src/sys/boot/boot2/boot1.s @@ -28,7 +28,7 @@ # Partition Constants .set PRT_OFF,0x1be # Partition offset .set PRT_NUM,0x4 # Partitions - .set PRT_BSD,0x2a # Partition type + .set PRT_BSD,0xAD # Partition type # Flag Bits .set FL_PACKET,0x80 # Packet mode diff --git a/src/sys/boot/boot2/boot2.c b/src/sys/boot/boot2/boot2.c index 35f4b4f..bfdc570 100644 --- a/src/sys/boot/boot2/boot2.c +++ b/src/sys/boot/boot2/boot2.c @@ -36,7 +36,7 @@ #include "lib.h" #include "ubixfs.h" -#define UBX_RESERVED 64 +#define UBX_RESERVED 0 #define RBX_ASKNAME 0x0 /* -a */ #define RBX_SINGLE 0x1 /* -s */ diff --git a/src/sys/boot/boot2/test.c b/src/sys/boot/boot2/test.c index c6f5bdd..430775d 100644 --- a/src/sys/boot/boot2/test.c +++ b/src/sys/boot/boot2/test.c @@ -11,12 +11,12 @@ d->magicNum2 = UBIXDISKMAGIC; d->numPartitions = 2; d->partitions[0].p_size = 2000; - d->partitions[0].p_offset = 50; - d->partitions[0].p_fstype = 0x24; + d->partitions[0].p_offset = 200; + d->partitions[0].p_fstype = 0xAD; d->partitions[0].p_bsize = 0x8; d->partitions[1].p_size = 2000; d->partitions[1].p_offset = 1000; - d->partitions[1].p_fstype = 0x24; + d->partitions[1].p_fstype = 0xAD; d->partitions[1].p_bsize = 0x8; d->partitions[2].p_size = 0; d->partitions[2].p_offset = 0; diff --git a/src/sys/boot/boot2/ubixfs.h b/src/sys/boot/boot2/ubixfs.h index 4c558d1..dc11906 100644 --- a/src/sys/boot/boot2/ubixfs.h +++ b/src/sys/boot/boot2/ubixfs.h @@ -1,4 +1,4 @@ -#define DOSPTYP_UBX 0x2A /* UbixFS partition type */ +#define DOSPTYP_UBX 0xAD /* UbixFS partition type */ #define UBIXDISKMAGIC ((u_int32_t)0x45) /* The disk magic number */ #define MAXUBIXPARTITIONS 16 #define UBIXFSMAGIC ((u_int32_t)0x69) /* The File System Magic Number */ diff --git a/src/sys/devfs/devfs.c b/src/sys/devfs/devfs.c index 6bd1880..2187b75 100644 --- a/src/sys/devfs/devfs.c +++ b/src/sys/devfs/devfs.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.5 2004/04/28 03:05:35 reddawg + Cleaned up some debug'n code + Revision 1.4 2004/04/28 02:37:34 reddawg More updates for using the new driver subsystem @@ -63,7 +66,7 @@ return(0x1); } //Return - mount(0x0,0x0,0x1,"devfs","rw"); // Mount Device File System + mount(0x0,0x0,0x0,0x1,"devfs","rw"); // Mount Device File System return(0x0); } diff --git a/src/sys/include/pci/hd.h b/src/sys/include/pci/hd.h index 7c029b3..79fa312 100644 --- a/src/sys/include/pci/hd.h +++ b/src/sys/include/pci/hd.h @@ -26,6 +26,7 @@ long hdPort; long hdSize; long hdCalc; + long parOffset; }; void initHardDisk(); diff --git a/src/sys/include/vfs/mount.h b/src/sys/include/vfs/mount.h index 3fdb7f4..b59aef3 100644 --- a/src/sys/include/vfs/mount.h +++ b/src/sys/include/vfs/mount.h @@ -38,7 +38,7 @@ char perms; }; -int mount(int driveId,int partition,int fsType,char *mountPoint,char *perms); +int mount(int major,int minor,int partition,int fsType,char *mountPoint,char *perms); int addMount(struct mountPoints *mp); struct mountPoints *findMount(char *mountPoint); diff --git a/src/sys/init/main.c b/src/sys/init/main.c index 3d9ebb3..e816e11 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.7 2004/04/26 22:27:36 reddawg + Now mounts our harddrive I need to either impliment fstab or do something similar + Revision 1.6 2004/04/25 04:35:50 reddawg Minor bug fixes to set default partition information @@ -157,22 +160,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,0x0,0x0,"hd","rw") != 0x0) { + */ + 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/pci/hd.c b/src/sys/pci/hd.c index 1c89456..ef2324a 100644 --- a/src/sys/pci/hd.c +++ b/src/sys/pci/hd.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.5 2004/04/28 02:37:34 reddawg + More updates for using the new driver subsystem + 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 @@ -55,17 +58,23 @@ #include struct driveInfo *hdd0; +struct driveInfo *hdd0s1; struct driveInfo *hdd1; struct driveInfo *hdd2; struct driveInfo *hdd3; void initHardDisk() { hdd0 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo),sysID); + hdd0s1 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo),sysID); hdd1 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo),sysID); hdd2 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo),sysID); hdd3 = (struct driveInfo *)kmalloc(sizeof(struct driveInfo),sysID); hdd0->hdPort = 0x1F0; hdd0->hdDev = 0x40; + hdd0->parOffset = 0x0; + hdd0s1->hdPort = 0x1F0; + hdd0s1->hdDev = 0x40; + hdd0s1->parOffset = 63; hdd1->hdPort = 0x1F0; hdd1->hdDev = 0x50; hdd2->hdPort = 0x177; @@ -73,7 +82,9 @@ hdd3->hdPort = 0x177; hdd3->hdDev = 0x50; deviceAdd(1,0,'c',hdRead,hdWrite,hdReset,hdInit,hdIoctl,hdStop,hdStart,hdStandby,hdd0); + deviceAdd(1,1,'c',hdRead,hdWrite,hdReset,hdInit,hdIoctl,hdStop,hdStart,hdStandby,hdd0s1); devFsMkNod("ad0",'c',0x1,0x0); + devFsMkNod("ad0s1",'c',0x1,0x1); /* if (!initDrive(hdd1)) { addDrive(2,1,hdd1,hdRead,hdWrite,0x0); @@ -189,6 +200,7 @@ long retVal = 0x0; short transactionCount = 0x0; short *tmp = (short *)baseAddr; + startSector += hdd->parOffset; if (hdd->hdEnable == 0x0) { kprintf("Invalid Drive\n"); return; @@ -250,6 +262,7 @@ long retVal = 0x0; short transactionCount = 0x0; short *tmp = (short *)baseAddr; + startSector += hdd->parOffset; if (hdd->hdEnable == 0x0) { kprintf("Invalid Drive\n"); return; diff --git a/src/sys/ubixfs/ubixfs.c b/src/sys/ubixfs/ubixfs.c index 66b2bc4..d216388 100644 --- a/src/sys/ubixfs/ubixfs.c +++ b/src/sys/ubixfs/ubixfs.c @@ -24,6 +24,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.3 2004/04/28 13:33:09 reddawg + Overhaul to ubixfs and boot loader and MBR to work well with our schema + now BAT and dir and file entries are all offset 64Sectors from the start of the partition + Revision 1.2 2004/04/28 02:22:55 reddawg This is a fiarly large commit but we are starting to use new driver model all around @@ -67,18 +71,15 @@ void initUbixFS(struct mountPoints *mp) { struct ubixFsInfo *fsInfo = 0x0; - mp->diskLabel = (struct ubixDiskLabel *)kmalloc(512,sysID); - kprintf("A"); - mp->device->read(mp->device->info,mp->diskLabel,1,1); - kprintf("B"); - mp->fsInfo = (struct ubixFsInfo *)kmalloc(sizeof(struct ubixFsInfo),-2); + mp->fsInfo = (struct ubixFsInfo *)kmalloc(sizeof(struct ubixFsInfo),sysID); fsInfo = mp->fsInfo; + mp->diskLabel->partitions[mp->partition].pOffset -= 63; if ((mp->diskLabel->magicNum == UBIXDISKMAGIC) && (mp->diskLabel->magicNum2 == UBIXDISKMAGIC)) { fsInfo->blockAllocationTable = (struct blockAllocationTableEntry *)kmalloc(mp->diskLabel->partitions[mp->partition].pBatSize*512,-2); /* fsInfo->blockAllocationTable[0].nextBlock = 100; */ fsInfo->batEntries = ((mp->diskLabel->partitions[mp->partition].pBatSize*512)/sizeof(struct blockAllocationTableEntry)); kprintf("C"); - mp->device->read(mp->device->info,fsInfo->blockAllocationTable,mp->diskLabel->partitions[mp->partition].pOffset+64,mp->diskLabel->partitions[mp->partition].pBatSize); + mp->device->read(mp->device->info,fsInfo->blockAllocationTable,mp->diskLabel->partitions[mp->partition].pOffset,mp->diskLabel->partitions[mp->partition].pBatSize); kprintf("Offset: [%i], Partition: [%i]\n",mp->diskLabel->partitions[mp->partition].pOffset,mp->partition); kprintf("UbixFS Initialized\n"); } diff --git a/src/sys/vfs/mount.c b/src/sys/vfs/mount.c index c8245b1..64c2502 100644 --- a/src/sys/vfs/mount.c +++ b/src/sys/vfs/mount.c @@ -24,6 +24,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.2 2004/04/28 02:22:55 reddawg + This is a fiarly large commit but we are starting to use new driver model + all around + Revision 1.1.1.1 2004/04/15 12:06:53 reddawg UbixOS v1.0 @@ -52,7 +56,7 @@ Notes: ************************************************************************/ -int mount(int driveId,int partition,int vfsType,char *mountPoint,char *perms) { +int mount(int major,int minor,int partition,int vfsType,char *mountPoint,char *perms) { struct mountPoints *mp = 0x0; struct deviceNode *device = 0x0; @@ -63,13 +67,18 @@ sprintf(mp->mountPoint,mountPoint); /* Set Pointer To Physical Drive */ - device = deviceFind(driveId,0x0); + device = deviceFind(major,minor); /* Set Up Mp Defaults */ mp->device = device; mp->fs = vfsFindFS(vfsType); mp->partition = partition; mp->perms = *perms; + if (device != 0x0) { + mp->diskLabel = (struct ubixDiskLabel *)kmalloc(512,sysID); + mp->device->read(mp->device->info,mp->diskLabel,1,1); + } + if (mp->fs == 0x0) { /* sysErr(systemErr,"File System Type: %i Not Found\n",fsType); */ kprintf("File System Type: %i Not Found\n",vfsType);