diff --git a/src/sys/include/isa/fdc.h b/src/sys/include/isa/fdc.h index c8bad87..a8d48f5 100644 --- a/src/sys/include/isa/fdc.h +++ b/src/sys/include/isa/fdc.h @@ -27,9 +27,9 @@ #include typedef struct DrvGeom { - byte heads; - byte tracks; - byte spt; + Int8 heads; + Int8 tracks; + Int8 spt; } drvGeom; @@ -58,20 +58,20 @@ void fdcInit(); void floppyIsr(); void floppyIsrhndlr(); -void sendByte(int byte); +void sendByte(int Int8); int getByte(); -bool fdcRw(int block,byte *blockBuffer,bool read,unsigned long numSectors); +bool fdcRw(int block,Int8 *blockBuffer,bool read,unsigned long numSectors); void block2Hts(int block,int *head,int *track,int *sector); void motorOn(void); void motorOff(void); bool seek(int track); bool waitFdc(bool sensei); int getByte(); -void sendByte(int byte); +void sendByte(int Int8); void recalibrate(void); void reset(void); -bool writeBlock(int block,byte *blockBuffer, unsigned long numSectors); -bool readBlock(int block,byte *blockBuffer, unsigned long numSectors); +bool writeBlock(int block,Int8 *blockBuffer, unsigned long numSectors); +bool readBlock(int block,Int8 *blockBuffer, unsigned long numSectors); void fdcWrite(void *info,void *,uInt32 startSector,uInt32 sectorCount); void fdcRead(void *info,void *,uInt32 startSector,uInt32 sectorCount); diff --git a/src/sys/include/sys/dma.h b/src/sys/include/sys/dma.h index 1fba28b..336f205 100644 --- a/src/sys/include/sys/dma.h +++ b/src/sys/include/sys/dma.h @@ -26,8 +26,8 @@ #include -void dmaXfer(uChar channel,uLong address,uInt length,uChar read); -void _dmaXfer(uChar dmaChannel,uChar page,uInt offset,uInt length,uChar mode); +void dmaXfer(uInt8 channel,uInt32 address,uInt length,uInt8 read); +void _dmaXfer(uInt8 dmaChannel,uInt8 page,uInt offset,uInt length,uInt8 mode); #endif diff --git a/src/sys/include/ubixfs/ubixfs.h b/src/sys/include/ubixfs/ubixfs.h index 35a9cdd..f364613 100644 --- a/src/sys/include/ubixfs/ubixfs.h +++ b/src/sys/include/ubixfs/ubixfs.h @@ -80,24 +80,24 @@ uInt32 lastModified; //Date Last Modified uInt32 uid; //UID Of Owner uInt32 gid; //GID Of Owner - uShort attributes; //Files Attributes - uShort permissions; //Files Permissions + uInt16 attributes; //Files Attributes + uInt16 permissions; //Files Permissions char fileName[256]; //File Name }; struct bootSect { - uChar jmp[4]; - uChar id[6]; - uShort version; - uShort tmp; - uShort fsStart; - uShort tmp2; + uInt8 jmp[4]; + uInt8 id[6]; + uInt16 version; + uInt16 tmp; + uInt16 fsStart; + uInt16 tmp2; uInt32 krnl_start; uInt BytesPerSector; uInt SectersPerTrack; uInt TotalHeads; uInt32 TotalSectors; - uChar code[479]; + uInt8 code[479]; }; struct ubixFsInfo { diff --git a/src/sys/include/ubixos/elf.h b/src/sys/include/ubixos/elf.h index 5d0cc5d..3d738bd 100644 --- a/src/sys/include/ubixos/elf.h +++ b/src/sys/include/ubixos/elf.h @@ -63,56 +63,56 @@ /* End Elf Program Header Types */ typedef struct { - uChar eIdent[16]; /* File identification. */ - uShort eType; /* File type. */ - uShort eMachine; /* Machine architecture. */ - uLong eVersion; /* ELF format version. */ - uLong eEntry; /* Entry point. */ - uLong ePhoff; /* Program header file offset. */ - uLong eShoff; /* Section header file offset. */ - uLong eFlags; /* Architecture-specific flags. */ - uShort eEhsize; /* Size of ELF header in bytes. */ - uShort ePhentsize; /* Size of program header entry. */ - uShort ePhnum; /* Number of program header entries. */ - uShort eShentsize; /* Size of section header entry. */ - uShort eShnum; /* Number of section header entries. */ - uShort eShstrndx; /* Section name strings section. */ + uInt8 eIdent[16]; /* File identification. */ + uInt16 eType; /* File type. */ + uInt16 eMachine; /* Machine architecture. */ + uInt32 eVersion; /* ELF format version. */ + uInt32 eEntry; /* Entry point. */ + uInt32 ePhoff; /* Program header file offset. */ + uInt32 eShoff; /* Section header file offset. */ + uInt32 eFlags; /* Architecture-specific flags. */ + uInt16 eEhsize; /* Size of ELF header in bytes. */ + uInt16 ePhentsize; /* Size of program header entry. */ + uInt16 ePhnum; /* Number of program header entries. */ + uInt16 eShentsize; /* Size of section header entry. */ + uInt16 eShnum; /* Number of section header entries. */ + uInt16 eShstrndx; /* Section name strings section. */ } elfHeader; typedef struct { - uLong phType; /* Entry type. */ - uLong phOffset; /* File offset of contents. */ - uLong phVaddr; /* Virtual address in memory image. */ - uLong phPaddr; /* Physical address (not used). */ - uLong phFilesz; /* Size of contents in file. */ - uLong phMemsz; /* Size of contents in memory. */ - uLong phFlags; /* Access permission flags. */ - uLong phAlign; /* Alignment in memory and file. */ + uInt32 phType; /* Entry type. */ + uInt32 phOffset; /* File offset of contents. */ + uInt32 phVaddr; /* Virtual address in memory image. */ + uInt32 phPaddr; /* Physical address (not used). */ + uInt32 phFilesz; /* Size of contents in file. */ + uInt32 phMemsz; /* Size of contents in memory. */ + uInt32 phFlags; /* Access permission flags. */ + uInt32 phAlign; /* Alignment in memory and file. */ } elfProgramheader; typedef struct { - uLong shName; /* Section name (index into the section header string table). */ - uLong shType; /* Section type. */ - uLong shFlags; /* Section flags. */ - uLong shAddr; /* Address in memory image. */ - uLong shOffset; /* Offset in file. */ - uLong shSize; /* Size in bytes. */ - uLong shLink; /* Index of a related section. */ - uLong shInfo; /* Depends on section type. */ - uLong shAddralign; /* Alignment in bytes. */ - uLong shEntsize; /* Size of each entry in section. */ + uInt32 shName; /* Section name (index into the section header string table). */ + uInt32 shType; /* Section type. */ + uInt32 shFlags; /* Section flags. */ + uInt32 shAddr; /* Address in memory image. */ + uInt32 shOffset; /* Offset in file. */ + uInt32 shSize; /* Size in bytes. */ + uInt32 shLink; /* Index of a related section. */ + uInt32 shInfo; /* Depends on section type. */ + uInt32 shAddralign; /* Alignment in bytes. */ + uInt32 shEntsize; /* Size of each entry in section. */ } elfSectionheader; typedef struct { - uLong pltOffset; - uLong pltInfo; + uInt32 pltOffset; + uInt32 pltInfo; } elfPltInfo; typedef struct { - uLong dynName; - uLong dynValue; - uLong dynSize; - uLong dynInfo; + uInt32 dynName; + uInt32 dynValue; + uInt32 dynSize; + uInt32 dynInfo; } elfDynsym; typedef struct { diff --git a/src/sys/include/ubixos/types.h b/src/sys/include/ubixos/types.h index 8119bb5..bb6ed41 100644 --- a/src/sys/include/ubixos/types.h +++ b/src/sys/include/ubixos/types.h @@ -30,26 +30,14 @@ #define NULL 0x0 #endif -typedef unsigned char byte; /* 8-bit byte */ -typedef unsigned short word; /* 16-bit word */ -typedef unsigned long dWord; /* 32-bit dword */ - -typedef unsigned char uChar; -typedef unsigned long uLong; -typedef unsigned short uShort; -typedef unsigned int uInt; - typedef unsigned char uInt8; typedef unsigned short uInt16; typedef unsigned long uInt32; +typedef unsigned int uInt; typedef char Int8; typedef short Int16; typedef long Int32; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; - typedef int pidType; typedef int pid_t; diff --git a/src/sys/include/vmm/vmm.h b/src/sys/include/vmm/vmm.h index 244e082..8b56bff 100644 --- a/src/sys/include/vmm/vmm.h +++ b/src/sys/include/vmm/vmm.h @@ -33,8 +33,8 @@ #define vmmMemoryMapAddr 0xE6667000 typedef struct { - uLong pageAddr; - uShort status; + uInt32 pageAddr; + uInt16 status; pid_t pid; int cowCounter; } mMap; diff --git a/src/sys/isa/fdc.c b/src/sys/isa/fdc.c index 6ae45a9..92324b6 100644 --- a/src/sys/isa/fdc.c +++ b/src/sys/isa/fdc.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.5 2004/04/29 15:29:20 reddawg + Fixed All Running Issues + 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 @@ -62,11 +65,11 @@ static drvGeom geometry = { dg144Heads,dg144Tracks,dg144Spt }; static bool diskChange = FALSE; static bool motor = FALSE; -static byte fdcTrack = 0xff; -static byte sr0 = 0; +static Int8 fdcTrack = 0xff; +static Int8 sr0 = 0; static volatile int timeOut = 0; -static byte statSize = 0; -static byte status[7] = { 0 }; +static Int8 statSize = 0; +static Int8 status[7] = { 0 }; unsigned long tbaddr = 0x80000L; @@ -107,13 +110,13 @@ outportByte(0x20,0x20); } -void sendByte(int byte) { +void sendByte(int Int8) { volatile int msr; int tmo; for (tmo=0;tmo<128;tmo++) { msr = inportByte(fdcMsr); if ((msr & 0xc0) == 0x80) { - outportByte(fdcData,byte); + outportByte(fdcData,Int8); return; } inportByte(0x80); @@ -133,7 +136,7 @@ return(-1); } -bool fdcRw(int block,byte *blockBuffer,bool read,unsigned long numSectors) { +bool fdcRw(int block,Int8 *blockBuffer,bool read,unsigned long numSectors) { int head,track,sector,tries, copyCount = 0; unsigned char *p_tbaddr = (char *)0x80000; unsigned char *p_blockbuff = blockBuffer; @@ -174,7 +177,7 @@ sendByte(track); sendByte(head); sendByte(sector); - sendByte(2); /* 512 bytes/sector */ + sendByte(2); /* 512 Int8s/sector */ sendByte(geometry.spt); if (geometry.spt == dg144Spt) { sendByte(dg144Gap3rw); /* gap 3 size for 1.44M read/write */ @@ -242,7 +245,7 @@ } } -bool readBlock(int block,byte *blockBuffer, unsigned long numSectors) { +bool readBlock(int block,Int8 *blockBuffer, unsigned long numSectors) { int track=0, sector=0, head=0, track2=0, result=0, loop=0; block2Hts(block, &head, &track, §or); block2Hts(block+numSectors, &head, &track2, §or); @@ -255,7 +258,7 @@ return fdcRw(block,blockBuffer,TRUE,numSectors); } -bool writeBlock(int block,byte *blockBuffer, unsigned long numSectors) { +bool writeBlock(int block,Int8 *blockBuffer, unsigned long numSectors) { return fdcRw(block,blockBuffer,FALSE, numSectors); } diff --git a/src/sys/kernel/exec.c b/src/sys/kernel/exec.c index 38dca92..0ddfe77 100644 --- a/src/sys/kernel/exec.c +++ b/src/sys/kernel/exec.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.1.1.1 2004/04/15 12:07:18 reddawg + UbixOS v1.0 + Revision 1.44 2004/04/13 16:16:44 reddawg Changed our copyright, it is all now under a BSD-Style license @@ -130,7 +133,7 @@ asm( "movl %0,%%eax \n" "movl %%eax,%%cr3 \n" - : : "d" ((uLong *)(_current->tss.cr3)) + : : "d" ((uInt32 *)(_current->tss.cr3)) ); /* Lets Find The File */ tmpFd = fopen(file,"r"); @@ -261,7 +264,7 @@ asm( "movl %0,%%eax \n" "movl %%eax,%%cr3 \n" - : : "d" ((uLong *)(kernelPageDirectory)) + : : "d" ((uInt32 *)(kernelPageDirectory)) ); /* Finally Return */ return; diff --git a/src/sys/lib/net.c b/src/sys/lib/net.c index e859209..c3e09f0 100644 --- a/src/sys/lib/net.c +++ b/src/sys/lib/net.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.1.1.1 2004/04/15 12:07:10 reddawg + UbixOS v1.0 + Revision 1.8 2004/04/13 21:29:52 reddawg We now have sockets working. Lots of functionality to be added to continually improve on the existing layers now its clean up time to get things in a better @@ -43,7 +46,7 @@ #include #ifndef _IN_ADDR_T_DECLARED -typedef uint32_t in_addr_t; +typedef uInt32 in_addr_t; #define _IN_ADDR_T_DECLARED #endif diff --git a/src/sys/sys/dma.c b/src/sys/sys/dma.c index 2dbe6d0..c1cdc79 100644 --- a/src/sys/sys/dma.c +++ b/src/sys/sys/dma.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.1.1.1 2004/04/15 12:07:17 reddawg + UbixOS v1.0 + Revision 1.2 2004/04/13 16:36:34 reddawg Changed our copyright, it is all now under a BSD-Style license @@ -40,14 +43,14 @@ #define lowByte(x) (x & 0x00FF) #define highByte(x) ((x & 0xFF00) >> 8) -uChar maskReg[8] = { 0x0A, 0x0A, 0x0A, 0x0A, 0xD4, 0xD4, 0xD4, 0xD4 }; -uChar clearReg[8] = { 0x0C, 0x0C, 0x0C, 0x0C, 0xD8, 0xD8, 0xD8, 0xD8 }; -uChar modeReg[8] = { 0x0B, 0x0B, 0x0B, 0x0B, 0xD6, 0xD6, 0xD6, 0xD6 }; -uChar addrPort[8] = { 0x00, 0x02, 0x04, 0x06, 0xC0, 0xC4, 0xC8, 0xCC }; -uChar pagePort[8] = { 0x87, 0x83, 0x81, 0x82, 0x8F, 0x8B, 0x89, 0x8A }; -uChar countPort[8] = { 0x01, 0x03, 0x05, 0x07, 0xC2, 0xC6, 0xCA, 0xCE }; +uInt8 maskReg[8] = { 0x0A, 0x0A, 0x0A, 0x0A, 0xD4, 0xD4, 0xD4, 0xD4 }; +uInt8 clearReg[8] = { 0x0C, 0x0C, 0x0C, 0x0C, 0xD8, 0xD8, 0xD8, 0xD8 }; +uInt8 modeReg[8] = { 0x0B, 0x0B, 0x0B, 0x0B, 0xD6, 0xD6, 0xD6, 0xD6 }; +uInt8 addrPort[8] = { 0x00, 0x02, 0x04, 0x06, 0xC0, 0xC4, 0xC8, 0xCC }; +uInt8 pagePort[8] = { 0x87, 0x83, 0x81, 0x82, 0x8F, 0x8B, 0x89, 0x8A }; +uInt8 countPort[8] = { 0x01, 0x03, 0x05, 0x07, 0xC2, 0xC6, 0xCA, 0xCE }; -void dmaXfer(uChar channel,uLong address,uInt length,uChar read) { +void dmaXfer(uInt8 channel,uInt32 address,uInt length,uInt8 read) { unsigned char page=0, mode=0; unsigned int offset = 0; if (read) { @@ -62,7 +65,7 @@ _dmaXfer(channel, page, offset, length, mode); } -void _dmaXfer(uChar dmaChannel,uChar page,uInt offset,uInt length,uChar mode) { +void _dmaXfer(uInt8 dmaChannel,uInt8 page,uInt offset,uInt length,uInt8 mode) { asm("cli"); outportByte(maskReg[dmaChannel], 0x04 | dmaChannel); outportByte(clearReg[dmaChannel], 0x00); diff --git a/src/sys/vmm/memory.c b/src/sys/vmm/memory.c index cbbe02a..36bd625 100644 --- a/src/sys/vmm/memory.c +++ b/src/sys/vmm/memory.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.1.1.1 2004/04/15 12:06:52 reddawg + UbixOS v1.0 + Revision 1.27 2004/04/13 16:36:34 reddawg Changed our copyright, it is all now under a BSD-Style license @@ -277,18 +280,18 @@ ************************************************************************/ void vmmFreeProcessPages(pidType pid) { int i=0,x=0; - uLong *tmpPageTable = 0x0; - uLong *tmpPageDir = (uLong *)parentPageDirAddr; + uInt32 *tmpPageTable = 0x0; + uInt32 *tmpPageDir = (uInt32 *)parentPageDirAddr; //Check Page Directory For An Avail Page Table for (i=0;i<=0x300;i++) { if (tmpPageDir[i] != 0) { //Set Up Page Table Pointer - tmpPageTable = (uLong *)(tablesBaseAddress + (i * 0x1000)); + tmpPageTable = (uInt32 *)(tablesBaseAddress + (i * 0x1000)); //Check The Page Table For COW Pages for (x=0;x