diff --git a/src/bin/ls/main.c b/src/bin/ls/main.c index 05f97b1..b2a5365 100755 --- a/src/bin/ls/main.c +++ b/src/bin/ls/main.c @@ -24,6 +24,12 @@ #include #include +#define permRead 0x8 +#define permWrite 0x4 +#define permExecute 0x2 +#define permHidden 0x1 + + //UbixFS Directory Entry struct directoryEntry { uLong startCluster; //Starting Cluster Of File @@ -38,8 +44,9 @@ }; int main() { - int i = 0x0; + int i = 0x0,x = 0x0,tmpPerms = 0x0; char *pwd = (char *)malloc(256); + char *permsData = (char *)malloc(12); FILE *fd; struct directoryEntry *dirEntry = (struct directoryEntry *)malloc(4096); if (!(fd = fopen("/","r"))) { @@ -53,7 +60,25 @@ pwd[0] = '/'; for (i=0;i<(4096/sizeof(struct directoryEntry));i++) { if ((dirEntry[i].fileName[0] > 0) && (dirEntry[i].fileName[0] != '/') && (dirEntry[i].fileName[0] != '.')) { - printf("%i %i %i %i %s\n",dirEntry[i].permissions,dirEntry[i].uid,dirEntry[i].gid,dirEntry[i].size,dirEntry[i].fileName); + for (x=0;x<12;x++) { + permsData[x] = '-'; + } + tmpPerms = ((dirEntry[i].permissions & 0xF00) >> 8); + if ((tmpPerms & permRead) == permRead) permsData[0] = 'R'; + if ((tmpPerms & permWrite) == permWrite) permsData[1] = 'W'; + if ((tmpPerms & permExecute) == permExecute) permsData[2] = 'E'; + if ((tmpPerms & permHidden) == permHidden) permsData[3] = 'H'; + tmpPerms = ((dirEntry[i].permissions & 0x0F0) >> 4); + if ((tmpPerms & permRead) == permRead) permsData[4] = 'R'; + if ((tmpPerms & permWrite) == permWrite) permsData[5] = 'W'; + if ((tmpPerms & permExecute) == permExecute) permsData[6] = 'E'; + if ((tmpPerms & permHidden) == permHidden) permsData[7] = 'H'; + tmpPerms = ((dirEntry[i].permissions & 0x00F) >> 0); + if ((tmpPerms & permRead) == permRead) permsData[8] = 'R'; + if ((tmpPerms & permWrite) == permWrite) permsData[9] = 'W'; + if ((tmpPerms & permExecute) == permExecute) permsData[10] = 'E'; + if ((tmpPerms & permHidden) == permHidden) permsData[11] = 'H'; + printf("%s %i %i %i %s\n",permsData,dirEntry[i].uid,dirEntry[i].gid,dirEntry[i].size,dirEntry[i].fileName); } } exit(1); diff --git a/src/sys/boot/bootsec.asm b/src/sys/boot/bootsec.asm index caa7c88..dedae6f 100755 --- a/src/sys/boot/bootsec.asm +++ b/src/sys/boot/bootsec.asm @@ -8,7 +8,7 @@ id db 'UbixFS' ;file system id version dd 1h ; Filing System Version -fs_start dd 130 ; LBA address for start of root dir +fs_start dd 257 ; LBA address for start of root dir krnl_size dd 59 ; Kernel size in sectors, starts at sector 1 BytesPerSector dw 512 SectorsPerTrack dw 18 @@ -22,10 +22,6 @@ xor ax, ax mov ds, ax mov [bootdrv], dl -;mov ax, 0x9000 -;mov ss, ax -;mov al,0x13 -;int 0x10 ; First get into protected mode cli n5: @@ -160,6 +156,21 @@ ; Re-enter protected mode ! A20 is already enabled + +;mov ax,0x4F01 +;mov cx,0x4115 +;mov bx,0x100 +;mov es,bx +;xor di,di +;xor bx,bx +;int 0x10 + + +;mov ax,0x4F02 +;mov bx,0x4115 +;int 0x10 + + ;mov ax, 0x4f0a ;xor bx,bx ;int 0x10 @@ -250,20 +261,20 @@ ; Returns: ; nothing -zero_memblock: - push eax ; Save the registers - push edi - push ecx - push es - mov es,ax - xor eax,eax ; Fill the memory with zeros (0x0) - cld ; Clear the direction flag; rep increments di - a32 rep stosb ; Fill the memory (one byte at a time) - pop es ; Restore the registers - pop ecx - pop edi - pop eax - ret ; Return to the main program +;zero_memblock: +; push eax ; Save the registers +; push edi +; push ecx +; push es +; mov es,ax +; xor eax,eax ; Fill the memory with zeros (0x0) +; cld ; Clear the direction flag; rep increments di +; a32 rep stosb ; Fill the memory (one byte at a time) +; pop es ; Restore the registers +; pop ecx +; pop edi +; pop eax +; ret ; Return to the main program ; Parameters ; DS:ESI = Source diff --git a/src/sys/init/main.c b/src/sys/init/main.c index 71d0553..c8f947d 100755 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -150,7 +150,7 @@ long xx = 0x0,yy = 0x0,zz = 0x0; uLong *testBuffer = 0x40000000; TMode_Rec *testVesa = 0x1000; - */ + */ initMmap(); //Initialize Memory Map clearScreen(); //Clear The Screen outputVersion(); //Display Version Info @@ -170,14 +170,12 @@ kprintf("BitsPerPixel: [%i]\n",testVesa->BitsPerPixel); kprintf("NumberOfBanks: [%i]\n",testVesa->NumberOfBanks); while(1); + */ - //testVesa->PhysBasePtr = 0x40151C80; - testVesa->PhysBasePtr -= (0x1000 * 16); + /* for (i=0;i<=(((testVesa->xRes*testVesa->yRes)*(testVesa->BitsPerPixel/1))+(0x1000-1));i+=0x1000) { remapPage((testVesa->PhysBasePtr + i),(0x40000000 + i)); } - */ - /* while (1) { for (zz=0; zz<64; zz++) for (yy=-128; yy<=128; yy++) @@ -213,7 +211,7 @@ */ execThread(idleThread,0xAFFF,"Idle Thread"); execFile("init"); - //kprintf("Free Pages: [%i]\n",freePages); + kprintf("Free Pages: [%i]\n",freePages); enableIrq(0); while (1); } diff --git a/src/tools/Makefile b/src/tools/Makefile index b19591f..0275735 100755 --- a/src/tools/Makefile +++ b/src/tools/Makefile @@ -49,7 +49,7 @@ (cp ../bin/ls/ls ./) (cp ../bin/pwd/pwd ./) (cp ../bin/login/login ./) - (./format 130 2000 init shell test ls pwd login) + (./format 257 2000 init shell test ls pwd login) (rm init) (rm shell) (rm test)