From ea36ff2c043da00de5880c5bcfc7ababe70aea83 Mon Sep 17 00:00:00 2001 From: rahmahkn <13519013@std.stei.itb.ac.id> Date: Fri, 23 Apr 2021 20:12:51 +0700 Subject: [PATCH] Benerin cd --- src/bochsout.txt | 84 +++++++++++++++++++++++------------------------ src/shell.c | 27 +++++++-------- src/system.img | Bin 1474560 -> 1474560 bytes 3 files changed, 56 insertions(+), 55 deletions(-) diff --git a/src/bochsout.txt b/src/bochsout.txt index d9ffe94..0ec6ba3 100644 --- a/src/bochsout.txt +++ b/src/bochsout.txt @@ -34,45 +34,45 @@ 00000000000i[ ] Sound support: SB16 ES1370 00000000000i[ ] USB support: UHCI OHCI EHCI xHCI 00000000000i[ ] VGA extension support: vbe cirrus voodoo -00000000000i[MEM0 ] allocated memory at 0x7fa63bd61010. after alignment, vector=0x7fa63bd62000 +00000000000i[MEM0 ] allocated memory at 0x7f1ca9750010. after alignment, vector=0x7f1ca9751000 00000000000i[MEM0 ] 32,00MB 00000000000i[MEM0 ] mem block size = 0x00020000, blocks=256 00000000000i[MEM0 ] rom at 0xfffe0000/131072 ('/usr/share/bochs/BIOS-bochs-latest') -00000000000i[ ] lt_dlhandle is 0x557dcf5872c0 +00000000000i[ ] lt_dlhandle is 0x55fe4ce0b2a0 00000000000i[PLUGIN] loaded plugin libbx_hdimage.so -00000000000i[ ] lt_dlhandle is 0x557dcfbc8020 +00000000000i[ ] lt_dlhandle is 0x55fe4d44c000 00000000000i[PLUGIN] loaded plugin libbx_soundalsa.so 00000000000i[WAVOUT] ALSA: opened default PCM output device 00000000000i[WAVOUT] changed sample rate to 44101 -00000000000i[ ] lt_dlhandle is 0x557dcfbe25f0 +00000000000i[ ] lt_dlhandle is 0x55fe4d46a630 00000000000i[PLUGIN] loaded plugin libbx_pci.so -00000000000i[ ] lt_dlhandle is 0x557dcfbc8bd0 +00000000000i[ ] lt_dlhandle is 0x55fe4d44cbb0 00000000000i[PLUGIN] loaded plugin libbx_pci2isa.so -00000000000i[ ] lt_dlhandle is 0x557dcfbf01b0 +00000000000i[ ] lt_dlhandle is 0x55fe4d473f90 00000000000i[PLUGIN] loaded plugin libbx_usb_uhci.so -00000000000i[ ] lt_dlhandle is 0x557dcfbf2870 +00000000000i[ ] lt_dlhandle is 0x55fe4d476650 00000000000i[PLUGIN] loaded plugin libbx_acpi.so -00000000000i[ ] lt_dlhandle is 0x557dcfbf30a0 +00000000000i[ ] lt_dlhandle is 0x55fe4d476e80 00000000000i[PLUGIN] loaded plugin libbx_hpet.so -00000000000i[ ] lt_dlhandle is 0x557dcfbf3f10 +00000000000i[ ] lt_dlhandle is 0x55fe4d477cf0 00000000000i[PLUGIN] loaded plugin libbx_cmos.so -00000000000i[ ] lt_dlhandle is 0x557dcfbf4870 +00000000000i[ ] lt_dlhandle is 0x55fe4d478650 00000000000i[PLUGIN] loaded plugin libbx_dma.so -00000000000i[ ] lt_dlhandle is 0x557dcfbf52c0 +00000000000i[ ] lt_dlhandle is 0x55fe4d4790a0 00000000000i[PLUGIN] loaded plugin libbx_pic.so -00000000000i[ ] lt_dlhandle is 0x557dcfbf5b20 +00000000000i[ ] lt_dlhandle is 0x55fe4d479900 00000000000i[PLUGIN] loaded plugin libbx_pit.so -00000000000i[ ] lt_dlhandle is 0x557dcfbf6520 +00000000000i[ ] lt_dlhandle is 0x55fe4d47a300 00000000000i[PLUGIN] loaded plugin libbx_vga.so -00000000000i[ ] lt_dlhandle is 0x557dcfbf6d80 +00000000000i[ ] lt_dlhandle is 0x55fe4d47ab60 00000000000i[PLUGIN] loaded plugin libbx_floppy.so -00000000000i[ ] lt_dlhandle is 0x557dcfbf7930 +00000000000i[ ] lt_dlhandle is 0x55fe4d47b710 00000000000i[PLUGIN] loaded plugin libbx_ioapic.so -00000000000i[ ] lt_dlhandle is 0x557dcfbf8130 +00000000000i[ ] lt_dlhandle is 0x55fe4d47bf10 00000000000i[PLUGIN] loaded plugin libbx_keyboard.so -00000000000i[ ] lt_dlhandle is 0x557dcfbf8900 +00000000000i[ ] lt_dlhandle is 0x55fe4d47c6e0 00000000000i[PLUGIN] loaded plugin libbx_harddrv.so -00000000000i[ ] lt_dlhandle is 0x557dcfbfab60 +00000000000i[ ] lt_dlhandle is 0x55fe4d47e940 00000000000i[PLUGIN] loaded plugin libbx_pci_ide.so 00000000000i[PLUGIN] init_dev of 'pci' plugin device by virtual method 00000000000i[DEV ] i440FX PMC present at device 0, function 0 @@ -80,7 +80,7 @@ 00000000000i[DEV ] PIIX3 PCI-to-ISA bridge present at device 1, function 0 00000000000i[PLUGIN] init_dev of 'cmos' plugin device by virtual method 00000000000i[CMOS ] Using local time for initial clock -00000000000i[CMOS ] Setting initial clock to: Fri Apr 23 21:03:46 2021 (time0=1619183026) +00000000000i[CMOS ] Setting initial clock to: Fri Apr 23 20:12:31 2021 (time0=1619183551) 00000000000i[PLUGIN] init_dev of 'dma' plugin device by virtual method 00000000000i[DMA ] channel 4 used by cascade 00000000000i[PLUGIN] init_dev of 'pic' plugin device by virtual method @@ -229,7 +229,7 @@ 00000427351i[BIOS ] Found 1 cpu(s) 00000441039i[BIOS ] bios_table_addr: 0x000f9db8 end=0x000fcc00 00000899957i[PCI ] i440FX PMC write to PAM register 59 (TLB Flush) -00001000000i[XGUI ] charmap update. Font is 9 x 16 +00001030950i[XGUI ] charmap update. Font is 9 x 16 00001358978i[P2ISA ] PCI IRQ routing: PIRQA# set to 0x0b 00001359003i[P2ISA ] PCI IRQ routing: PIRQB# set to 0x09 00001359028i[P2ISA ] PCI IRQ routing: PIRQC# set to 0x0b @@ -265,26 +265,26 @@ 00002009681i[BXVGA ] VBE known Display Interface b0c0 00002009713i[BXVGA ] VBE known Display Interface b0c5 00002012356i[VBIOS ] VBE Bios $Id: vbe.c 228 2020-01-02 23:09:02Z vruppert $ -00002199550i[XGUI ] charmap update. Font is 9 x 16 +00003236630i[XGUI ] charmap update. Font is 9 x 16 00032863656i[BIOS ] Booting from 0000:7c00 -00335190000p[XGUI ] >>PANIC<< POWER button turned off. -00335190000i[CPU0 ] CPU is in real mode (active) -00335190000i[CPU0 ] CS.mode = 16 bit -00335190000i[CPU0 ] SS.mode = 16 bit -00335190000i[CPU0 ] EFER = 0x00000000 -00335190000i[CPU0 ] | EAX=00000034 EBX=00000000 ECX=00090000 EDX=00000000 -00335190000i[CPU0 ] | ESP=0000fd69 EBP=0000fd83 ESI=000e01ea EDI=0000ffac -00335190000i[CPU0 ] | IOPL=0 id vip vif ac vm rf nt of df if tf sf ZF af PF cf -00335190000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D -00335190000i[CPU0 ] | CS:f000( 0004| 0| 0) 000f0000 0000ffff 0 0 -00335190000i[CPU0 ] | DS:0040( 0005| 0| 0) 00000400 0000ffff 0 0 -00335190000i[CPU0 ] | SS:2000( 0005| 0| 0) 00020000 0000ffff 0 0 -00335190000i[CPU0 ] | ES:2000( 0005| 0| 0) 00020000 0000ffff 0 0 -00335190000i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 -00335190000i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 -00335190000i[CPU0 ] | EIP=0000e86d (0000e86d) -00335190000i[CPU0 ] | CR0=0x60000010 CR2=0x00000000 -00335190000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000 -00335190000i[CMOS ] Last time is 1619183059 (Fri Apr 23 21:04:19 2021) -00335190000i[XGUI ] Exit -00335190000i[SIM ] quit_sim called with exit code 1 +00479170000p[XGUI ] >>PANIC<< POWER button turned off. +00479170000i[CPU0 ] CPU is in real mode (active) +00479170000i[CPU0 ] CS.mode = 16 bit +00479170000i[CPU0 ] SS.mode = 16 bit +00479170000i[CPU0 ] EFER = 0x00000000 +00479170000i[CPU0 ] | EAX=00000024 EBX=00000000 ECX=00090000 EDX=00000000 +00479170000i[CPU0 ] | ESP=0000fd69 EBP=0000fd83 ESI=000e01ea EDI=0000ffac +00479170000i[CPU0 ] | IOPL=0 id vip vif ac vm rf nt of df IF tf sf ZF af PF cf +00479170000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D +00479170000i[CPU0 ] | CS:f000( 0004| 0| 0) 000f0000 0000ffff 0 0 +00479170000i[CPU0 ] | DS:0040( 0005| 0| 0) 00000400 0000ffff 0 0 +00479170000i[CPU0 ] | SS:2000( 0005| 0| 0) 00020000 0000ffff 0 0 +00479170000i[CPU0 ] | ES:2000( 0005| 0| 0) 00020000 0000ffff 0 0 +00479170000i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +00479170000i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +00479170000i[CPU0 ] | EIP=0000e869 (0000e869) +00479170000i[CPU0 ] | CR0=0x60000010 CR2=0x00000000 +00479170000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000 +00479170000i[CMOS ] Last time is 1619183598 (Fri Apr 23 20:13:18 2021) +00479170000i[XGUI ] Exit +00479170000i[SIM ] quit_sim called with exit code 1 diff --git a/src/shell.c b/src/shell.c index 2d88b48..0725848 100644 --- a/src/shell.c +++ b/src/shell.c @@ -180,24 +180,25 @@ int cd(char* cmd, int idxDir) { directory[i] = '\0'; } i = 0; - while (i<128 && cmd[i] != '\0' && cont == 1) { - if (cmd[i] != '/') { + while(i<128 && cmd[i] != '\0' && cont == 1) { + if(cmd[i] != '/') { directory[cnt] = cmd[i]; cnt++; - } else if (cmd[i] == '/') { + } else if(cmd[i] == '/') { val = lookingPath(directory, initDir); if(val == 0x100) { cont = 0; } else { + interrupt(0x21, 0, "Berhasil pindah directory\r\n",0,0); initDir = val; currentDirName[namaDir++] = '/'; k = 0; while (k < 14 ) { - if (bufferDir[initDir * 16 + 2 + k] != '\0') { + if (bufferDir[initDir * 16 + 2 + k] == '\0') { + break; + } else { currentDirName[namaDir + k] = bufferDir[k + initDir * 16 + 2]; k++; - } else { - break; } } namaDir += k; @@ -206,20 +207,20 @@ int cd(char* cmd, int idxDir) { } i++; } - if (cont) { val = lookingPath(directory, initDir); - if (val == 0x100) { - if (backDir == 0) { + if (val != 0x100) { + interrupt(0x21, 0, "Berhasil pindah directory\r\n",0,0); + if (backDir ==0) { initDir = val; currentDirName[namaDir++] = '/'; k = 0; - while (k < 14) { - if (bufferDir[initDir * 16 + 2 + k] != '\0') { + while (k < 14 ) { + if (bufferDir[initDir * 16 + 2 + k] == '\0') { + break; + } else { currentDirName[namaDir + k] = bufferDir[k + initDir * 16 + 2]; k++; - } else { - break; } } namaDir += k; diff --git a/src/system.img b/src/system.img index b2dc57d6eda0beed740dd609b911e6562659f266..ff2a9d39e5f275c3de4f2622a6c0eac33f03d342 100644 GIT binary patch delta 1908 zcmcIkZ)_7~7{9xAg_W(V9d)}5mvvj&psj7C%tkubE%UMvgT-@dFpi*1nDS?oZs{gT z7rL>PQjEN01V1d`5)zGQby2F#prI23`oUx$2)Zbl1+OWRxDdgxS)b>6+jU<|G_fD< zetmww_j!KLbMN~O3~U=1*cL6We#Eb{C&nEtJe>Hjv81xvNk_>`)rNqJhXj}^TFwU+bCuV8W+J*JY*TL{1V%ZA?LV;_pa$tu{EN8cOsiNN>#n+D~ZXv;1rks3K!C3w(^K z^2EcXd`u-3`v$4>V@jMB@LQTlwE6O(bb%IsZ+M0f-5EVm`;yxL!?aO6<;_9kp z*$?Ms{}`#XGPgD$t)(<1U>x40MNaDIklfLqY6!=&lqb@0mls|xgznSLOsoLx^-2jE zN%LB%xV;4Ba% z6Snj(ednsd34?2bbgXw&w5z}hj1=#K$k;tN7>hT>CUSl~Z`8}KX9_@?DU;@}k%=TR zn(FEI$QILvBDEZTg+xrXMStj)?h+H3G;O7CkP3>+PtC4ugmr-g*FCcONKs^MVHB1ihoT2yJ6yA#y07F z`aIuzp6C7E`(AfUKACR)R`AVu0j<4d)~CN%-MkTs3R60Bc^!$;22d%~WAsnjFqXb!qmN+ZSLy}cam z&p1c-!L_`|JBc|KRr*5#T#BQ4-%PFFl4HGbyhv*?riOzgVT*oobsArl-Y0M(RG7x& zsQm8yo>Beoutyiki>k%VS`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