From 3155f0ec7fb015225c6ae42f782b8c25f2d79f88 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 19 Jul 2013 11:47:17 +1200 Subject: Committed --- Makefile | 13 + apijmps.asm | 23 ++ bochsout.txt | 159 ++++++++ bootbanner.asm | 48 +++ disasm | 1054 ++++++++++++++++++++++++++++++++++++++++++++++++++++ diskio.asm | 147 ++++++-- emergencyshell.asm | 68 ++++ kernel.asm | 83 +++++ keyb.asm | 68 ++++ monitor.asm | 243 ++++++++++++ panic.asm | 91 +++++ power.asm | 56 +++ strings.asm | 120 +++--- strutils.asm | 344 +++++++++++++++++ 14 files changed, 2453 insertions(+), 64 deletions(-) create mode 100644 Makefile create mode 100644 apijmps.asm create mode 100644 bochsout.txt create mode 100644 bootbanner.asm create mode 100644 disasm create mode 100644 emergencyshell.asm create mode 100644 kernel.asm create mode 100644 keyb.asm create mode 100644 monitor.asm create mode 100644 panic.asm create mode 100644 power.asm create mode 100644 strutils.asm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..dfde908 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +SOURCES = kernel.asm +MOUNT_POINT = /home/david/jaspos/floppy/ +TARGET = $(MOUNT_POINT)kernel.run + +all: + - sudo mount ../floppy.img $(MOUNT_POINT) + - sudo nasm $(SOURCES) -o $(TARGET) + - sudo umount $(MOUNT_POINT) + - ./lines.pl + - make run + +run: + - bochs -f ../bochsrc -q diff --git a/apijmps.asm b/apijmps.asm new file mode 100644 index 0000000..a7dfc2e --- /dev/null +++ b/apijmps.asm @@ -0,0 +1,23 @@ +apijmps: + jmp word jaspos + jmp word jaspos_monitor_clear + jmp word jaspos_monitor_dispstring + jmp word jaspos_monitor_dispchar + jmp word jaspos_monitor_getcursorxy + jmp word jaspos_monitor_init + jmp word jaspos_keyb_getkey + jmp word jaspos_keyb_getstring + jmp word jaspos_strutils_d2str + jmp word jaspos_strutils_compare + jmp word jaspos_strutils_hex2str + jmp word jaspos_strutils_instr + jmp word jaspos_strutils_strlen + jmp word jaspos_strutils_tolower + jmp word jaspos_strutils_toupper + jmp word jaspos_strutils_trimleading + jmp word jaspos_strutils_trimtrailing + jmp word jaspos_strutils_trim + jmp word jaspos_disk_readsector + jmp word jaspos_disk_reset + jmp word jaspos_power_connect + jmp word jaspos_power_shutdown \ No newline at end of file diff --git a/bochsout.txt b/bochsout.txt new file mode 100644 index 0000000..ea62b6a --- /dev/null +++ b/bochsout.txt @@ -0,0 +1,159 @@ +00000000000i[ ] Bochs x86 Emulator 2.6 +00000000000i[ ] Built from SVN snapshot on September 2nd, 2012 +00000000000i[ ] Compiled on Sep 11 2012 at 22:31:23 +00000000000i[ ] System configuration +00000000000i[ ] processors: 1 (cores=1, HT threads=1) +00000000000i[ ] A20 line support: yes +00000000000i[ ] IPS is set to 4000000 +00000000000i[ ] CPU configuration +00000000000i[ ] level: 6 +00000000000i[ ] SMP support: no +00000000000i[ ] APIC support: xapic +00000000000i[ ] FPU support: yes +00000000000i[ ] MMX support: yes +00000000000i[ ] 3dnow! support: yes +00000000000i[ ] SEP support: yes +00000000000i[ ] SSE support: sse2 +00000000000i[ ] XSAVE support: no +00000000000i[ ] AES support: no +00000000000i[ ] MOVBE support: no +00000000000i[ ] ADX support: no +00000000000i[ ] x86-64 support: no +00000000000i[ ] MWAIT support: yes +00000000000i[ ] Optimization configuration +00000000000i[ ] RepeatSpeedups support: no +00000000000i[ ] Fast function calls: no +00000000000i[ ] Handlers Chaining speedups: no +00000000000i[ ] Devices configuration +00000000000i[ ] NE2000 support: no +00000000000i[ ] PCI support: no, enabled=yes +00000000000i[ ] SB16 support: no +00000000000i[ ] USB support: no +00000000000i[ ] VGA extension support: vbe +00000000000i[MEM0 ] allocated memory at 0xb64ff008. after alignment, vector=0xb6500000 +00000000000i[MEM0 ] 8.00MB +00000000000i[MEM0 ] mem block size = 0x00100000, blocks=8 +00000000000i[MEM0 ] rom at 0xfffe0000/131072 ('/usr/share/bochs/BIOS-bochs-latest') +00000000000e[DEV ] Bochs is not compiled with PCI support +00000000000i[ ] init_dev of 'cmos' plugin device by virtual method +00000000000i[CMOS ] Using local time for initial clock +00000000000i[CMOS ] Setting initial clock to: Wed May 29 13:52:39 2013 (time0=1369792359) +00000000000i[ ] init_dev of 'dma' plugin device by virtual method +00000000000i[DMA ] channel 4 used by cascade +00000000000i[ ] init_dev of 'pic' plugin device by virtual method +00000000000i[ ] init_dev of 'pit' plugin device by virtual method +00000000000i[ ] init_dev of 'floppy' plugin device by virtual method +00000000000i[DMA ] channel 2 used by Floppy Drive +00000000000i[FDD ] tried to open '/home/david/jaspos/floppy.img' read/write: Permission denied +00000000000i[FDD ] fd0: '/home/david/jaspos/floppy.img' ro=1, h=2,t=80,spt=18 +00000000000i[ ] init_dev of 'vga' plugin device by virtual method +00000000000i[MEM0 ] Register memory access handlers: 0x00000000000a0000 - 0x00000000000bffff +00000000000i[VGA ] interval=200000 +00000000000i[MEM0 ] Register memory access handlers: 0x00000000e0000000 - 0x00000000e0ffffff +00000000000i[BXVGA] VBE Bochs Display Extension Enabled +00000000000i[XGUI ] test_alloc_colors: 16 colors available out of 16 colors tried +00000000000i[XGUI ] font 8 wide x 16 high, display depth = 24 +00000000000i[MEM0 ] rom at 0xc0000/41472 ('/usr/share/bochs/VGABIOS-lgpl-latest') +00000000000i[ ] init_dev of 'ioapic' plugin device by virtual method +00000000000i[IOAP ] initializing I/O APIC +00000000000i[MEM0 ] Register memory access handlers: 0x00000000fec00000 - 0x00000000fec00fff +00000000000i[ ] init_dev of 'keyboard' plugin device by virtual method +00000000000i[KBD ] will paste characters every 1000 keyboard ticks +00000000000i[ ] init_dev of 'harddrv' plugin device by virtual method +00000000000i[HD ] Using boot sequence floppy, none, none +00000000000i[HD ] Floppy boot signature check is enabled +00000000000i[ ] init_dev of 'unmapped' plugin device by virtual method +00000000000i[ ] init_dev of 'biosdev' plugin device by virtual method +00000000000i[ ] init_dev of 'speaker' plugin device by virtual method +00000000000i[ ] init_dev of 'extfpuirq' plugin device by virtual method +00000000000i[ ] init_dev of 'parallel' plugin device by virtual method +00000000000i[PAR ] parallel port 1 at 0x0378 irq 7 +00000000000i[ ] init_dev of 'serial' plugin device by virtual method +00000000000i[SER ] com1 at 0x03f8 irq 4 +00000000000i[ ] register state of 'cmos' plugin device by virtual method +00000000000i[ ] register state of 'dma' plugin device by virtual method +00000000000i[ ] register state of 'pic' plugin device by virtual method +00000000000i[ ] register state of 'pit' plugin device by virtual method +00000000000i[ ] register state of 'floppy' plugin device by virtual method +00000000000i[ ] register state of 'vga' plugin device by virtual method +00000000000i[ ] register state of 'unmapped' plugin device by virtual method +00000000000i[ ] register state of 'biosdev' plugin device by virtual method +00000000000i[ ] register state of 'speaker' plugin device by virtual method +00000000000i[ ] register state of 'extfpuirq' plugin device by virtual method +00000000000i[ ] register state of 'parallel' plugin device by virtual method +00000000000i[ ] register state of 'serial' plugin device by virtual method +00000000000i[ ] register state of 'ioapic' plugin device by virtual method +00000000000i[ ] register state of 'keyboard' plugin device by virtual method +00000000000i[ ] register state of 'harddrv' plugin device by virtual method +00000000000i[SYS ] bx_pc_system_c::Reset(HARDWARE) called +00000000000i[CPU0 ] cpu hardware reset +00000000000i[APIC0] allocate APIC id=0 (MMIO enabled) to 0x00000000fee00000 +00000000000i[CPU0 ] CPUID[0x00000000]: 00000002 68747541 444d4163 69746e65 +00000000000i[CPU0 ] CPUID[0x00000001]: 00000633 00010800 00000008 17cbfbff +00000000000i[CPU0 ] CPUID[0x00000002]: 00000000 00000000 00000000 00000000 +00000000000i[CPU0 ] CPUID[0x80000000]: 80000008 68747541 444d4163 69746e65 +00000000000i[CPU0 ] CPUID[0x80000001]: 00000633 00000000 00000000 c1c3f3ff +00000000000i[CPU0 ] CPUID[0x80000002]: 20444d41 6c687441 74286e6f 7020296d +00000000000i[CPU0 ] CPUID[0x80000003]: 65636f72 726f7373 00000000 00000000 +00000000000i[CPU0 ] CPUID[0x80000004]: 00000000 00000000 00000000 00000000 +00000000000i[CPU0 ] CPUID[0x80000005]: 01ff01ff 01ff01ff 40020140 40020140 +00000000000i[CPU0 ] CPUID[0x80000006]: 00000000 42004200 02008140 00000000 +00000000000i[CPU0 ] CPUID[0x80000007]: 00000000 00000000 00000000 00000000 +00000000000i[CPU0 ] CPUID[0x80000008]: 00002028 00000000 00000000 00000000 +00000000000i[ ] reset of 'cmos' plugin device by virtual method +00000000000i[ ] reset of 'dma' plugin device by virtual method +00000000000i[ ] reset of 'pic' plugin device by virtual method +00000000000i[ ] reset of 'pit' plugin device by virtual method +00000000000i[ ] reset of 'floppy' plugin device by virtual method +00000000000i[ ] reset of 'vga' plugin device by virtual method +00000000000i[ ] reset of 'ioapic' plugin device by virtual method +00000000000i[ ] reset of 'keyboard' plugin device by virtual method +00000000000i[ ] reset of 'harddrv' plugin device by virtual method +00000000000i[ ] reset of 'unmapped' plugin device by virtual method +00000000000i[ ] reset of 'biosdev' plugin device by virtual method +00000000000i[ ] reset of 'speaker' plugin device by virtual method +00000000000e[SPEAK] Failed to open /dev/console: Permission denied +00000000000e[SPEAK] Deactivating beep on console +00000000000i[ ] reset of 'extfpuirq' plugin device by virtual method +00000000000i[ ] reset of 'parallel' plugin device by virtual method +00000000000i[ ] reset of 'serial' plugin device by virtual method +00000000000i[XGUI ] Mouse capture off +00000000025i[MEM0 ] allocate_block: block=0x0 used 0x1 of 0x8 +00000004661i[BIOS ] $Revision: 11318 $ $Date: 2012-08-06 19:59:54 +0200 (Mo, 06. Aug 2012) $ +00000317668i[KBD ] reset-disable command received +00000318806i[BIOS ] Starting rombios32 +00000319240i[BIOS ] Shutdown flag 0 +00000319823i[BIOS ] ram_size=0x00800000 +00000320221i[BIOS ] ram_end=8MB +00000360726i[BIOS ] Found 1 cpu(s) +00000374908i[BIOS ] bios_table_addr: 0x000fa438 end=0x000fcc00 +00000393368i[BIOS ] bios_table_cur_addr: 0x000fa438 +00000520985i[VBIOS] VGABios $Id: vgabios.c,v 1.75 2011/10/15 14:07:21 vruppert Exp $ +00000521056i[BXVGA] VBE known Display Interface b0c0 +00000521088i[BXVGA] VBE known Display Interface b0c5 +00000524013i[VBIOS] VBE Bios $Id: vbe.c,v 1.64 2011/07/19 18:25:05 vruppert Exp $ +00000800002i[XGUI ] charmap update. Font Height is 16 +00012942446i[BIOS ] Booting from 0000:7c00 +00156380000p[XGUI ] >>PANIC<< POWER button turned off. +00156380000i[CPU0 ] CPU is in real mode (active) +00156380000i[CPU0 ] CS.mode = 16 bit +00156380000i[CPU0 ] SS.mode = 16 bit +00156380000i[CPU0 ] EFER = 0x00000000 +00156380000i[CPU0 ] | EAX=00000028 EBX=00000941 ECX=0009001f EDX=00000042 +00156380000i[CPU0 ] | ESP=0000ffdf EBP=00000184 ESI=000e0946 EDI=00000941 +00156380000i[CPU0 ] | IOPL=0 id vip vif ac vm rf nt of df if tf sf ZF af PF cf +00156380000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D +00156380000i[CPU0 ] | CS:f000( 0004| 0| 0) 000f0000 0000ffff 0 0 +00156380000i[CPU0 ] | DS:0040( 0005| 0| 0) 00000400 0000ffff 0 0 +00156380000i[CPU0 ] | SS:2000( 0005| 0| 0) 00020000 0000ffff 0 0 +00156380000i[CPU0 ] | ES:1000( 0005| 0| 0) 00010000 0000ffff 0 0 +00156380000i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +00156380000i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +00156380000i[CPU0 ] | EIP=0000e86d (0000e86d) +00156380000i[CPU0 ] | CR0=0x60000010 CR2=0x00000000 +00156380000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000 +00156380000i[CPU0 ] 0x0000e86d>> cmp ax, word ptr ds:0x1c : 3B061C00 +00156380000i[CMOS ] Last time is 1369792398 (Wed May 29 13:53:18 2013) +00156380000i[XGUI ] Exit +00156380000i[ ] restoring default signal behavior +00156380000i[CTRL ] quit_sim called with exit code 1 diff --git a/bootbanner.asm b/bootbanner.asm new file mode 100644 index 0000000..d6abd25 --- /dev/null +++ b/bootbanner.asm @@ -0,0 +1,48 @@ +;####################################### +; BOOT BANNER +; Displays a nice info banner on boot +jaspos_bootbanner: + ; Print nice horizontal line + push msgHLine + call jaspos_monitor_dispstring + + ; Show version + push msgVersion + call jaspos_monitor_dispstring + + ; Show compile date + push msgCompileDate + call jaspos_monitor_dispstring + + ; Print disk label + push msgDiskLabel + call jaspos_monitor_dispstring + + ; Convert and print Drive number + mov [free_ram+5], byte 0 + push free_ram + 4 ; Convert drive number to a string. + push word [Drive] ; This code preps the buffer ready for the banner, in case a slow processor's + call jaspos_strutils_d2str ; running the code - just to make the display as smooth as possible + push msgDrive + call jaspos_monitor_dispstring + push free_ram + call jaspos_monitor_dispstring + push msgNewLine + call jaspos_monitor_dispstring + + push msgStackSize + call jaspos_monitor_dispstring + mov [free_ram+4], byte 0 + push free_ram + 3 + push STACK_SIZE + call jaspos_strutils_hex2str + push free_ram + call jaspos_monitor_dispstring + push msgNewLine + call jaspos_monitor_dispstring + + ; Print nice horizontal line + push msgHLine + call jaspos_monitor_dispstring + ret +;####################################### \ No newline at end of file diff --git a/disasm b/disasm new file mode 100644 index 0000000..3b9c99f --- /dev/null +++ b/disasm @@ -0,0 +1,1054 @@ +00000000 E93900 jmp word 0x3c +00000003 E96D02 jmp word 0x273 +00000006 E9BE01 jmp word 0x1c7 +00000009 E9E801 jmp word 0x1f4 +0000000C E9A102 jmp word 0x2b0 +0000000F E95502 jmp word 0x267 +00000012 E97803 jmp word 0x38d +00000015 E97A03 jmp word 0x392 +00000018 E9E103 jmp word 0x3fc +0000001B E9BE03 jmp word 0x3dc +0000001E E9A703 jmp word 0x3c8 +00000021 E9F103 jmp word 0x415 +00000024 E9F502 jmp word 0x31c +00000027 E9FF02 jmp word 0x329 +0000002A E9A502 jmp word 0x2d2 +0000002D E9C702 jmp word 0x2f7 +00000030 E90904 jmp word 0x43c +00000033 E92004 jmp word 0x456 +00000036 E93904 jmp word 0x472 +00000039 E95304 jmp word 0x48f +0000003C 8CC8 mov ax,cs +0000003E 8ED8 mov ds,ax +00000040 8EC0 mov es,ax +00000042 050010 add ax,0x1000 +00000045 8ED0 mov ss,ax +00000047 30F6 xor dh,dh +00000049 89161A08 mov [0x81a],dx +0000004D BCFFFF mov sp,0xffff +00000050 E82002 call word 0x273 +00000053 E80803 call word 0x35e +00000056 68E904 push word 0x4e9 +00000059 E86B01 call word 0x1c7 +0000005C 680030 push word 0x3000 +0000005F E83502 call word 0x297 +00000062 E85802 call word 0x2bd +00000065 688805 push word 0x588 +00000068 E85C01 call word 0x1c7 +0000006B E80401 call word 0x172 +0000006E 68D007 push word 0x7d0 +00000071 E85301 call word 0x1c7 +00000074 681B08 push word 0x81b +00000077 6A20 push byte +0x20 +00000079 E81603 call word 0x392 +0000007C 682407 push word 0x724 +0000007F E84501 call word 0x1c7 +00000082 681B08 push word 0x81b +00000085 E8B403 call word 0x43c +00000088 68E707 push word 0x7e7 +0000008B 681B08 push word 0x81b +0000008E E88403 call word 0x415 +00000091 7428 jz 0xbb +00000093 68EC07 push word 0x7ec +00000096 681B08 push word 0x81b +00000099 E87903 call word 0x415 +0000009C 740D jz 0xab +0000009E 68F407 push word 0x7f4 +000000A1 681B08 push word 0x81b +000000A4 E86E03 call word 0x415 +000000A7 740A jz 0xb3 +000000A9 EBC3 jmp short 0x6e +000000AB 68BF06 push word 0x6bf +000000AE E81601 call word 0x1c7 +000000B1 EBBB jmp short 0x6e +000000B3 687906 push word 0x679 +000000B6 E80E01 call word 0x1c7 +000000B9 EBB3 jmp short 0x6e +000000BB 68C907 push word 0x7c9 +000000BE E80601 call word 0x1c7 +000000C1 682407 push word 0x724 +000000C4 E80001 call word 0x1c7 +000000C7 54 push sp +000000C8 55 push bp +000000C9 57 push di +000000CA 56 push si +000000CB 0FA8 push gs +000000CD 16 push ss +000000CE 06 push es +000000CF 1E push ds +000000D0 0E push cs +000000D1 52 push dx +000000D2 51 push cx +000000D3 53 push bx +000000D4 50 push ax +000000D5 680F06 push word 0x60f +000000D8 E8EC00 call word 0x1c7 +000000DB 682405 push word 0x524 +000000DE E8E600 call word 0x1c7 +000000E1 58 pop ax +000000E2 E87A00 call word 0x15f +000000E5 682B05 push word 0x52b +000000E8 E8DC00 call word 0x1c7 +000000EB 58 pop ax +000000EC E87000 call word 0x15f +000000EF 683305 push word 0x533 +000000F2 E8D200 call word 0x1c7 +000000F5 58 pop ax +000000F6 E86600 call word 0x15f +000000F9 683B05 push word 0x53b +000000FC E8C800 call word 0x1c7 +000000FF 58 pop ax +00000100 E85C00 call word 0x15f +00000103 684305 push word 0x543 +00000106 E8BE00 call word 0x1c7 +00000109 58 pop ax +0000010A E85200 call word 0x15f +0000010D 684A05 push word 0x54a +00000110 E8B400 call word 0x1c7 +00000113 58 pop ax +00000114 E84800 call word 0x15f +00000117 685205 push word 0x552 +0000011A E8AA00 call word 0x1c7 +0000011D 58 pop ax +0000011E E83E00 call word 0x15f +00000121 685A05 push word 0x55a +00000124 E8A000 call word 0x1c7 +00000127 58 pop ax +00000128 E83400 call word 0x15f +0000012B 686205 push word 0x562 +0000012E E89600 call word 0x1c7 +00000131 58 pop ax +00000132 E82A00 call word 0x15f +00000135 686905 push word 0x569 +00000138 E88C00 call word 0x1c7 +0000013B 58 pop ax +0000013C E82000 call word 0x15f +0000013F 687105 push word 0x571 +00000142 E88200 call word 0x1c7 +00000145 58 pop ax +00000146 E81600 call word 0x15f +00000149 688105 push word 0x581 +0000014C E87800 call word 0x1c7 +0000014F 58 pop ax +00000150 E80C00 call word 0x15f +00000153 687905 push word 0x579 +00000156 E86E00 call word 0x1c7 +00000159 58 pop ax +0000015A E80200 call word 0x15f +0000015D EB0E jmp short 0x16d +0000015F 683307 push word 0x733 +00000162 50 push ax +00000163 E87602 call word 0x3dc +00000166 682E07 push word 0x72e +00000169 E85B00 call word 0x1c7 +0000016C C3 ret +0000016D E81D02 call word 0x38d +00000170 EBFB jmp short 0x16d +00000172 68B105 push word 0x5b1 +00000175 E84F00 call word 0x1c7 +00000178 68BF06 push word 0x6bf +0000017B E84900 call word 0x1c7 +0000017E 687906 push word 0x679 +00000181 E84300 call word 0x1c7 +00000184 68A306 push word 0x6a3 +00000187 E83D00 call word 0x1c7 +0000018A 682C07 push word 0x72c +0000018D FF361A08 push word [0x81a] +00000191 E86802 call word 0x3fc +00000194 68DD06 push word 0x6dd +00000197 E82D00 call word 0x1c7 +0000019A 682807 push word 0x728 +0000019D E82700 call word 0x1c7 +000001A0 682407 push word 0x724 +000001A3 E82100 call word 0x1c7 +000001A6 680206 push word 0x602 +000001A9 E81B00 call word 0x1c7 +000001AC 683307 push word 0x733 +000001AF 6AFF push byte -0x1 +000001B1 E82802 call word 0x3dc +000001B4 682E07 push word 0x72e +000001B7 E80D00 call word 0x1c7 +000001BA 682407 push word 0x724 +000001BD E80700 call word 0x1c7 +000001C0 68B105 push word 0x5b1 +000001C3 E80100 call word 0x1c7 +000001C6 C3 ret +000001C7 58 pop ax +000001C8 5E pop si +000001C9 50 push ax +000001CA 06 push es +000001CB 51 push cx +000001CC 52 push dx +000001CD E89700 call word 0x267 +000001D0 AC lodsb +000001D1 3C00 cmp al,0x0 +000001D3 7414 jz 0x1e9 +000001D5 3C01 cmp al,0x1 +000001D7 740A jz 0x1e3 +000001D9 50 push ax +000001DA E81700 call word 0x1f4 +000001DD 8B3E3507 mov di,[0x735] +000001E1 EBED jmp short 0x1d0 +000001E3 AC lodsb +000001E4 A22707 mov [0x727],al +000001E7 EBE7 jmp short 0x1d0 +000001E9 893E3507 mov [0x735],di +000001ED E8CD00 call word 0x2bd +000001F0 59 pop cx +000001F1 5A pop dx +000001F2 07 pop es +000001F3 C3 ret +000001F4 5A pop dx +000001F5 58 pop ax +000001F6 52 push dx +000001F7 06 push es +000001F8 57 push di +000001F9 E86B00 call word 0x267 +000001FC 81FFA00F cmp di,0xfa0 +00000200 7D3E jnl 0x240 +00000202 3C08 cmp al,0x8 +00000204 7414 jz 0x21a +00000206 3C0D cmp al,0xd +00000208 741F jz 0x229 +0000020A 3C0A cmp al,0xa +0000020C 7421 jz 0x22f +0000020E AA stosb +0000020F A02707 mov al,[0x727] +00000212 AA stosb +00000213 893E3507 mov [0x735],di +00000217 5F pop di +00000218 07 pop es +00000219 C3 ret +0000021A 83EF02 sub di,byte +0x2 +0000021D B020 mov al,0x20 +0000021F AA stosb +00000220 83EF02 sub di,byte +0x2 +00000223 A02707 mov al,[0x727] +00000226 AA stosb +00000227 EBEA jmp short 0x213 +00000229 81C7A000 add di,0xa0 +0000022D EBE4 jmp short 0x213 +0000022F 89F8 mov ax,di +00000231 31D2 xor dx,dx +00000233 BFA000 mov di,0xa0 +00000236 F7F7 div di +00000238 F7E7 mul di +0000023A 89C7 mov di,ax +0000023C 31C0 xor ax,ax +0000023E EBD3 jmp short 0x213 +00000240 1E push ds +00000241 50 push ax +00000242 57 push di +00000243 56 push si +00000244 B900B8 mov cx,0xb800 +00000247 8ED9 mov ds,cx +00000249 BEA000 mov si,0xa0 +0000024C 31FF xor di,di +0000024E B9000F mov cx,0xf00 +00000251 F3A4 rep movsb +00000253 30C0 xor al,al +00000255 B9A000 mov cx,0xa0 +00000258 BF000F mov di,0xf00 +0000025B F3AA rep stosb +0000025D 5E pop si +0000025E 5F pop di +0000025F 81EFA000 sub di,0xa0 +00000263 58 pop ax +00000264 1F pop ds +00000265 EB9B jmp short 0x202 +00000267 50 push ax +00000268 B800B8 mov ax,0xb800 +0000026B 8EC0 mov es,ax +0000026D 8B3E3507 mov di,[0x735] +00000271 58 pop ax +00000272 C3 ret +00000273 50 push ax +00000274 51 push cx +00000275 57 push di +00000276 06 push es +00000277 6A00 push byte +0x0 +00000279 E81B00 call word 0x297 +0000027C E8E8FF call word 0x267 +0000027F 31FF xor di,di +00000281 B9D007 mov cx,0x7d0 +00000284 B020 mov al,0x20 +00000286 AA stosb +00000287 A02707 mov al,[0x727] +0000028A AA stosb +0000028B E2F7 loop 0x284 +0000028D 31C0 xor ax,ax +0000028F A33507 mov [0x735],ax +00000292 07 pop es +00000293 5F pop di +00000294 59 pop cx +00000295 58 pop ax +00000296 C3 ret +00000297 5B pop bx +00000298 58 pop ax +00000299 53 push bx +0000029A 51 push cx +0000029B 89C1 mov cx,ax +0000029D 30E4 xor ah,ah +0000029F BBA000 mov bx,0xa0 +000002A2 F7E3 mul bx +000002A4 C1E908 shr cx,byte 0x8 +000002A7 D0E1 shl cl,1 +000002A9 01C8 add ax,cx +000002AB A33507 mov [0x735],ax +000002AE 59 pop cx +000002AF C3 ret +000002B0 52 push dx +000002B1 A13507 mov ax,[0x735] +000002B4 BAA000 mov dx,0xa0 +000002B7 F6F2 div dl +000002B9 D0EC shr ah,1 +000002BB 5A pop dx +000002BC C3 ret +000002BD 50 push ax +000002BE 53 push bx +000002BF 52 push dx +000002C0 E8EDFF call word 0x2b0 +000002C3 88C6 mov dh,al +000002C5 88E2 mov dl,ah +000002C7 B80002 mov ax,0x200 +000002CA 30FF xor bh,bh +000002CC CD10 int 0x10 +000002CE 5A pop dx +000002CF 5B pop bx +000002D0 58 pop ax +000002D1 C3 ret +000002D2 683707 push word 0x737 +000002D5 E8EFFE call word 0x1c7 +000002D8 B80153 mov ax,0x5301 +000002DB 31DB xor bx,bx +000002DD CD15 int 0x15 +000002DF 7201 jc 0x2e2 +000002E1 C3 ret +000002E2 680707 push word 0x707 +000002E5 E8DFFE call word 0x1c7 +000002E8 682807 push word 0x728 +000002EB 50 push ax +000002EC E80D01 call word 0x3fc +000002EF 682807 push word 0x728 +000002F2 E8D2FE call word 0x1c7 +000002F5 EBEA jmp short 0x2e1 +000002F7 B80753 mov ax,0x5307 +000002FA BB0100 mov bx,0x1 +000002FD B90300 mov cx,0x3 +00000300 CD15 int 0x15 +00000302 7201 jc 0x305 +00000304 C3 ret +00000305 680707 push word 0x707 +00000308 E8BCFE call word 0x1c7 +0000030B 682807 push word 0x728 +0000030E 50 push ax +0000030F E8EA00 call word 0x3fc +00000312 682807 push word 0x728 +00000315 E8AFFE call word 0x1c7 +00000318 E9ACFD jmp word 0xc7 +0000031B C3 ret +0000031C 52 push dx +0000031D 50 push ax +0000031E 8A161A08 mov dl,[0x81a] +00000322 30E4 xor ah,ah +00000324 CD13 int 0x13 +00000326 58 pop ax +00000327 5A pop dx +00000328 C3 ret +00000329 58 pop ax +0000032A 59 pop cx +0000032B 5B pop bx +0000032C 50 push ax +0000032D 51 push cx +0000032E E80900 call word 0x33a +00000331 30ED xor ch,ch +00000333 B001 mov al,0x1 +00000335 B402 mov ah,0x2 +00000337 CD13 int 0x13 +00000339 C3 ret +0000033A 5A pop dx +0000033B 58 pop ax +0000033C 52 push dx +0000033D 31D2 xor dx,dx +0000033F F7360E08 div word [0x80e] +00000343 FEC2 inc dl +00000345 88D1 mov cl,dl +00000347 89D8 mov ax,bx +00000349 31D2 xor dx,dx +0000034B F7360E08 div word [0x80e] +0000034F 31D2 xor dx,dx +00000351 F7361008 div word [0x810] +00000355 88D6 mov dh,dl +00000357 88C5 mov ch,al +00000359 8A161A08 mov dl,[0x81a] +0000035D C3 ret +0000035E E8BBFF call word 0x31c +00000361 0F8262FD jc word 0xc7 +00000365 BB1B08 mov bx,0x81b +00000368 8A161A08 mov dl,[0x81a] +0000036C 30F6 xor dh,dh +0000036E 30ED xor ch,ch +00000370 B001 mov al,0x1 +00000372 B402 mov ah,0x2 +00000374 CD13 int 0x13 +00000376 BFB006 mov di,0x6b0 +00000379 BE4608 mov si,0x846 +0000037C B90B00 mov cx,0xb +0000037F F3A4 rep movsb +00000381 B91900 mov cx,0x19 +00000384 BE2608 mov si,0x826 +00000387 BF0108 mov di,0x801 +0000038A F3A4 rep movsb +0000038C C3 ret +0000038D 31C0 xor ax,ax +0000038F CD16 int 0x16 +00000391 C3 ret +00000392 58 pop ax +00000393 59 pop cx +00000394 5F pop di +00000395 50 push ax +00000396 89FB mov bx,di +00000398 49 dec cx +00000399 51 push cx +0000039A E8F0FF call word 0x38d +0000039D 3C0D cmp al,0xd +0000039F 7420 jz 0x3c1 +000003A1 3C08 cmp al,0x8 +000003A3 7413 jz 0x3b8 +000003A5 3C20 cmp al,0x20 +000003A7 7C0C jl 0x3b5 +000003A9 AA stosb +000003AA 50 push ax +000003AB E846FE call word 0x1f4 +000003AE E80CFF call word 0x2bd +000003B1 E2E7 loop 0x39a +000003B3 EB0C jmp short 0x3c1 +000003B5 41 inc cx +000003B6 E2E2 loop 0x39a +000003B8 41 inc cx +000003B9 39DF cmp di,bx +000003BB 74DD jz 0x39a +000003BD 41 inc cx +000003BE 4F dec di +000003BF EBE9 jmp short 0x3aa +000003C1 30C0 xor al,al +000003C3 AA stosb +000003C4 58 pop ax +000003C5 29C8 sub ax,cx +000003C7 C3 ret +000003C8 58 pop ax +000003C9 5E pop si +000003CA 50 push ax +000003CB 51 push cx +000003CC 31C9 xor cx,cx +000003CE AC lodsb +000003CF 3C00 cmp al,0x0 +000003D1 7403 jz 0x3d6 +000003D3 41 inc cx +000003D4 EBF8 jmp short 0x3ce +000003D6 48 dec ax +000003D7 4E dec si +000003D8 89C8 mov ax,cx +000003DA 59 pop cx +000003DB C3 ret +000003DC 5D pop bp +000003DD 58 pop ax +000003DE 5F pop di +000003DF 55 push bp +000003E0 BBB907 mov bx,0x7b9 +000003E3 FD std +000003E4 B90200 mov cx,0x2 +000003E7 50 push ax +000003E8 C0E004 shl al,byte 0x4 +000003EB C0E804 shr al,byte 0x4 +000003EE D7 xlatb +000003EF AA stosb +000003F0 58 pop ax +000003F1 C0E804 shr al,byte 0x4 +000003F4 D7 xlatb +000003F5 AA stosb +000003F6 86E0 xchg ah,al +000003F8 E2ED loop 0x3e7 +000003FA FC cld +000003FB C3 ret +000003FC FD std +000003FD 5D pop bp +000003FE 5A pop dx +000003FF 5F pop di +00000400 55 push bp +00000401 B90500 mov cx,0x5 +00000404 89D0 mov ax,dx +00000406 31D2 xor dx,dx +00000408 BB0A00 mov bx,0xa +0000040B F7F3 div bx +0000040D 92 xchg ax,dx +0000040E 0C30 or al,0x30 +00000410 AA stosb +00000411 E2F1 loop 0x404 +00000413 FC cld +00000414 C3 ret +00000415 5D pop bp +00000416 5E pop si +00000417 5F pop di +00000418 55 push bp +00000419 87F7 xchg si,di +0000041B AC lodsb +0000041C 88C3 mov bl,al +0000041E 87F7 xchg si,di +00000420 AC lodsb +00000421 38D8 cmp al,bl +00000423 7510 jnz 0x435 +00000425 3C00 cmp al,0x0 +00000427 7407 jz 0x430 +00000429 80FB00 cmp bl,0x0 +0000042C 7402 jz 0x430 +0000042E EBE9 jmp short 0x419 +00000430 31C0 xor ax,ax +00000432 39C0 cmp ax,ax +00000434 C3 ret +00000435 B80100 mov ax,0x1 +00000438 83F802 cmp ax,byte +0x2 +0000043B C3 ret +0000043C 5D pop bp +0000043D 5E pop si +0000043E 50 push ax +0000043F 55 push bp +00000440 89F7 mov di,si +00000442 AC lodsb +00000443 3C00 cmp al,0x0 +00000445 740D jz 0x454 +00000447 3C41 cmp al,0x41 +00000449 7C06 jl 0x451 +0000044B 3C5A cmp al,0x5a +0000044D 7F02 jg 0x451 +0000044F 0C20 or al,0x20 +00000451 AA stosb +00000452 EBEE jmp short 0x442 +00000454 5F pop di +00000455 C3 ret +00000456 5D pop bp +00000457 5E pop si +00000458 55 push bp +00000459 57 push di +0000045A 50 push ax +0000045B 89F7 mov di,si +0000045D AC lodsb +0000045E 3C00 cmp al,0x0 +00000460 740D jz 0x46f +00000462 3C61 cmp al,0x61 +00000464 7C06 jl 0x46c +00000466 3C7A cmp al,0x7a +00000468 7F02 jg 0x46c +0000046A 24DF and al,0xdf +0000046C AA stosb +0000046D EBEE jmp short 0x45d +0000046F 58 pop ax +00000470 5F pop di +00000471 C3 ret +00000472 5D pop bp +00000473 5E pop si +00000474 55 push bp +00000475 57 push di +00000476 89F7 mov di,si +00000478 56 push si +00000479 E84CFF call word 0x3c8 +0000047C 89C1 mov cx,ax +0000047E 89FE mov si,di +00000480 51 push cx +00000481 AC lodsb +00000482 3C20 cmp al,0x20 +00000484 7502 jnz 0x488 +00000486 E2F9 loop 0x481 +00000488 59 pop cx +00000489 4E dec si +0000048A 41 inc cx +0000048B F3A4 rep movsb +0000048D 5F pop di +0000048E C3 ret +0000048F 5D pop bp +00000490 5E pop si +00000491 55 push bp +00000492 57 push di +00000493 56 push si +00000494 E831FF call word 0x3c8 +00000497 89C1 mov cx,ax +00000499 FD std +0000049A 4E dec si +0000049B AC lodsb +0000049C 3C20 cmp al,0x20 +0000049E 74FB jz 0x49b +000004A0 FC cld +000004A1 83C602 add si,byte +0x2 +000004A4 89F7 mov di,si +000004A6 31C0 xor ax,ax +000004A8 AA stosb +000004A9 5F pop di +000004AA C3 ret +000004AB 5D pop bp +000004AC 5E pop si +000004AD 5F pop di +000004AE 55 push bp +000004AF 51 push cx +000004B0 52 push dx +000004B1 89F1 mov cx,si +000004B3 89FA mov dx,di +000004B5 87F7 xchg si,di +000004B7 AC lodsb +000004B8 3C00 cmp al,0x0 +000004BA 7414 jz 0x4d0 +000004BC 88C3 mov bl,al +000004BE 87F7 xchg si,di +000004C0 AC lodsb +000004C1 3C00 cmp al,0x0 +000004C3 7411 jz 0x4d6 +000004C5 38D8 cmp al,bl +000004C7 74EC jz 0x4b5 +000004C9 41 inc cx +000004CA 89CE mov si,cx +000004CC 89D7 mov di,dx +000004CE EBE5 jmp short 0x4b5 +000004D0 5A pop dx +000004D1 59 pop cx +000004D2 B80100 mov ax,0x1 +000004D5 C3 ret +000004D6 5A pop dx +000004D7 59 pop cx +000004D8 31C0 xor ax,ax +000004DA C3 ret +000004DB 5D pop bp +000004DC 58 pop ax +000004DD 55 push bp +000004DE 50 push ax +000004DF 50 push ax +000004E0 E88FFF call word 0x472 +000004E3 58 pop ax +000004E4 50 push ax +000004E5 E8A7FF call word 0x48f +000004E8 C3 ret +000004E9 0109 add [bx+di],cx +000004EB 4A dec dx +000004EC 010A add [bp+si],cx +000004EE 61 popaw +000004EF 010B add [bp+di],cx +000004F1 7301 jnc 0x4f4 +000004F3 0C70 or al,0x70 +000004F5 010D add [di],cx +000004F7 6F outsw +000004F8 010E7320 add [0x2073],cx +000004FC 011F add [bx],bx +000004FE 687474 push word 0x7474 +00000501 703A jo 0x53d +00000503 2F das +00000504 2F das +00000505 626174 bound sp,[bx+di+0x74] +00000508 636862 arpl [bx+si+0x62],bp +0000050B 696E2E7565 imul bp,[bp+0x2e],word 0x6575 +00000510 756F jnz 0x581 +00000512 2E636F6D arpl [cs:bx+0x6d],bp +00000516 2F das +00000517 6A61 push byte +0x61 +00000519 7370 jnc 0x58b +0000051B 6F outsw +0000051C 732E jnc 0x54c +0000051E 7068 jo 0x588 +00000520 7001 jo 0x523 +00000522 07 pop es +00000523 000D add [di],cl +00000525 0A4158 or al,[bx+di+0x58] +00000528 3A20 cmp ah,[bx+si] +0000052A 0020 add [bx+si],ah +0000052C 2020 and [bx+si],ah +0000052E 42 inc dx +0000052F 58 pop ax +00000530 3A20 cmp ah,[bx+si] +00000532 0020 add [bx+si],ah +00000534 2020 and [bx+si],ah +00000536 43 inc bx +00000537 58 pop ax +00000538 3A20 cmp ah,[bx+si] +0000053A 0020 add [bx+si],ah +0000053C 2020 and [bx+si],ah +0000053E 44 inc sp +0000053F 58 pop ax +00000540 3A20 cmp ah,[bx+si] +00000542 000D add [di],cl +00000544 0A4353 or al,[bp+di+0x53] +00000547 3A20 cmp ah,[bx+si] +00000549 0020 add [bx+si],ah +0000054B 2020 and [bx+si],ah +0000054D 44 inc sp +0000054E 53 push bx +0000054F 3A20 cmp ah,[bx+si] +00000551 0020 add [bx+si],ah +00000553 2020 and [bx+si],ah +00000555 45 inc bp +00000556 53 push bx +00000557 3A20 cmp ah,[bx+si] +00000559 0020 add [bx+si],ah +0000055B 2020 and [bx+si],ah +0000055D 53 push bx +0000055E 53 push bx +0000055F 3A20 cmp ah,[bx+si] +00000561 000D add [di],cl +00000563 0A4753 or al,[bx+0x53] +00000566 3A20 cmp ah,[bx+si] +00000568 0020 add [bx+si],ah +0000056A 2020 and [bx+si],ah +0000056C 53 push bx +0000056D 49 dec cx +0000056E 3A20 cmp ah,[bx+si] +00000570 0020 add [bx+si],ah +00000572 2020 and [bx+si],ah +00000574 44 inc sp +00000575 49 dec cx +00000576 3A20 cmp ah,[bx+si] +00000578 0020 add [bx+si],ah +0000057A 2020 and [bx+si],ah +0000057C 53 push bx +0000057D 50 push ax +0000057E 3A20 cmp ah,[bx+si] +00000580 000D add [di],cl +00000582 0A4250 or al,[bp+si+0x50] +00000585 3A20 cmp ah,[bx+si] +00000587 0001 add [bx+di],al +00000589 0C3C or al,0x3c +0000058B 010A add [bp+si],cx +0000058D 53 push bx +0000058E 746F jz 0x5ff +00000590 7020 jo 0x5b2 +00000592 7361 jnc 0x5f5 +00000594 7969 jns 0x5ff +00000596 6E outsb +00000597 6720746865 and [dword eax+ebp*2+0x65],dh +0000059C 20706F and [bx+si+0x6f],dh +0000059F 6F outsw +000005A0 6C insb +000005A1 27 daa +000005A2 7320 jnc 0x5c4 +000005A4 636C6F arpl [si+0x6f],bp +000005A7 7365 jnc 0x60e +000005A9 642101 and [fs:bx+di],ax +000005AC 0C3E or al,0x3e +000005AE 0107 add [bx],ax +000005B0 00C4 add ah,al +000005B2 C4 db 0xc4 +000005B3 C4 db 0xc4 +000005B4 C4 db 0xc4 +000005B5 C4 db 0xc4 +000005B6 C4 db 0xc4 +000005B7 C4 db 0xc4 +000005B8 C4 db 0xc4 +000005B9 C4 db 0xc4 +000005BA C4 db 0xc4 +000005BB C4 db 0xc4 +000005BC C4 db 0xc4 +000005BD C4 db 0xc4 +000005BE C4 db 0xc4 +000005BF C4 db 0xc4 +000005C0 C4 db 0xc4 +000005C1 C4 db 0xc4 +000005C2 C4 db 0xc4 +000005C3 C4 db 0xc4 +000005C4 C4 db 0xc4 +000005C5 C4 db 0xc4 +000005C6 C4 db 0xc4 +000005C7 C4 db 0xc4 +000005C8 C4 db 0xc4 +000005C9 C4 db 0xc4 +000005CA C4 db 0xc4 +000005CB C4 db 0xc4 +000005CC C4 db 0xc4 +000005CD C4 db 0xc4 +000005CE C4 db 0xc4 +000005CF C4 db 0xc4 +000005D0 C4 db 0xc4 +000005D1 C4 db 0xc4 +000005D2 C4 db 0xc4 +000005D3 C4 db 0xc4 +000005D4 C4 db 0xc4 +000005D5 C4 db 0xc4 +000005D6 C4 db 0xc4 +000005D7 C4 db 0xc4 +000005D8 C4 db 0xc4 +000005D9 C4 db 0xc4 +000005DA C4 db 0xc4 +000005DB C4 db 0xc4 +000005DC C4 db 0xc4 +000005DD C4 db 0xc4 +000005DE C4 db 0xc4 +000005DF C4 db 0xc4 +000005E0 C4 db 0xc4 +000005E1 C4 db 0xc4 +000005E2 C4 db 0xc4 +000005E3 C4 db 0xc4 +000005E4 C4 db 0xc4 +000005E5 C4 db 0xc4 +000005E6 C4 db 0xc4 +000005E7 C4 db 0xc4 +000005E8 C4 db 0xc4 +000005E9 C4 db 0xc4 +000005EA C4 db 0xc4 +000005EB C4 db 0xc4 +000005EC C4 db 0xc4 +000005ED C4 db 0xc4 +000005EE C4 db 0xc4 +000005EF C4 db 0xc4 +000005F0 C4 db 0xc4 +000005F1 C4 db 0xc4 +000005F2 C4 db 0xc4 +000005F3 C4 db 0xc4 +000005F4 C4 db 0xc4 +000005F5 C4 db 0xc4 +000005F6 C4 db 0xc4 +000005F7 C4 db 0xc4 +000005F8 C4 db 0xc4 +000005F9 C4 db 0xc4 +000005FA C4 db 0xc4 +000005FB C4 db 0xc4 +000005FC C4 db 0xc4 +000005FD C4 db 0xc4 +000005FE C4 db 0xc4 +000005FF C4 db 0xc4 +00000600 C400 les ax,[bx+si] +00000602 53 push bx +00000603 7461 jz 0x666 +00000605 636B20 arpl [bp+di+0x20],bp +00000608 53 push bx +00000609 697A653A20 imul di,[bp+si+0x65],word 0x203a +0000060E 0001 add [bx+di],al +00000610 0C4B or al,0x4b +00000612 65726E gs jc 0x683 +00000615 656C gs insb +00000617 207061 and [bx+si+0x61],dh +0000061A 6E outsb +0000061B 696321204F imul sp,[bp+di+0x21],word 0x4f20 +00000620 682067 push word 0x6720 +00000623 6F outsw +00000624 642C20 fs sub al,0x20 +00000627 6F outsw +00000628 682067 push word 0x6720 +0000062B 6F outsw +0000062C 642C20 fs sub al,0x20 +0000062F 4F dec di +00000630 48 dec ax +00000631 20474F and [bx+0x4f],al +00000634 44 inc sp +00000635 210D and [di],cx +00000637 0A01 or al,[bx+di] +00000639 0A4F68 or cl,[bx+0x68] +0000063C 2C20 sub al,0x20 +0000063E 6A75 push byte +0x75 +00000640 7374 jnc 0x6b6 +00000642 206967 and [bx+di+0x67],ch +00000645 6E outsb +00000646 6F outsw +00000647 7265 jc 0x6ae +00000649 206869 and [bx+si+0x69],ch +0000064C 6D insw +0000064D 2C20 sub al,0x20 +0000064F 686572 push word 0x7265 +00000652 6527 gs daa +00000654 7320 jnc 0x676 +00000656 7468 jz 0x6c0 +00000658 65207265 and [gs:bp+si+0x65],dh +0000065C 676973746572 imul si,[ebx+0x74],word 0x7265 +00000662 206475 and [si+0x75],ah +00000665 6D insw +00000666 7020 jo 0x688 +00000668 796F jns 0x6d9 +0000066A 7520 jnz 0x68c +0000066C 61 popaw +0000066D 736B jnc 0x6da +0000066F 656420666F and [fs:bp+0x6f],ah +00000674 723A jc 0x6b0 +00000676 0107 add [bx],ax +00000678 00436F add [bp+di+0x6f],al +0000067B 6D insw +0000067C 7069 jo 0x6e7 +0000067E 6C insb +0000067F 65643A20 cmp ah,[fs:bx+si] +00000683 3230 xor dh,[bx+si] +00000685 3133 xor [bp+di],si +00000687 2D3034 sub ax,0x3430 +0000068A 2D3235 sub ax,0x3532 +0000068D 206174 and [bx+di+0x74],ah +00000690 2032 and [bp+si],dh +00000692 303A xor [bp+si],bh +00000694 35303A xor ax,0x3a30 +00000697 353820 xor ax,0x2038 +0000069A 55 push bp +0000069B 54 push sp +0000069C 43 inc bx +0000069D 2B31 sub si,[bx+di] +0000069F 320D xor cl,[di] +000006A1 0A00 or al,[bx+si] +000006A3 44 inc sp +000006A4 69736B204C imul si,[bp+di+0x6b],word 0x4c20 +000006A9 61 popaw +000006AA 62656C bound sp,[di+0x6c] +000006AD 3A20 cmp ah,[bx+si] +000006AF 27 daa +000006B0 2020 and [bx+si],ah +000006B2 2020 and [bx+si],ah +000006B4 2020 and [bx+si],ah +000006B6 2020 and [bx+si],ah +000006B8 2020 and [bx+si],ah +000006BA 2027 and [bx],ah +000006BC 0D0A00 or ax,0xa +000006BF 56 push si +000006C0 657273 gs jc 0x736 +000006C3 696F6E3A20 imul bp,[bx+0x6e],word 0x203a +000006C8 4A dec dx +000006C9 61 popaw +000006CA 7370 jnc 0x73c +000006CC 6F outsw +000006CD 7320 jnc 0x6ef +000006CF 50 push ax +000006D0 7265 jc 0x737 +000006D2 204275 and [bp+si+0x75],al +000006D5 696C642031 imul bp,[si+0x64],word 0x3120 +000006DA 0D0A00 or ax,0xa +000006DD 44 inc sp +000006DE 7269 jc 0x749 +000006E0 7665 jna 0x747 +000006E2 3A20 cmp ah,[bx+si] +000006E4 00446F add [si+0x6f],al +000006E7 6E outsb +000006E8 650D0A00 gs or ax,0xa +000006EC 010A add [bp+si],cx +000006EE 53 push bx +000006EF 7563 jnz 0x754 +000006F1 636573 arpl [di+0x73],sp +000006F4 7301 jnc 0x6f7 +000006F6 07 pop es +000006F7 0D0A00 or ax,0xa +000006FA 010C add [si],cx +000006FC 46 inc si +000006FD 61 popaw +000006FE 696C656401 imul bp,[si+0x65],word 0x164 +00000703 07 pop es +00000704 0D0A00 or ax,0xa +00000707 010C add [si],cx +00000709 46 inc si +0000070A 61 popaw +0000070B 696C656401 imul bp,[si+0x65],word 0x164 +00000710 07 pop es +00000711 207769 and [bx+0x69],dh +00000714 7468 jz 0x77e +00000716 206572 and [di+0x72],ah +00000719 726F jc 0x78a +0000071B 7220 jc 0x73d +0000071D 636F64 arpl [bx+0x64],bp +00000720 653A20 cmp ah,[gs:bx+si] +00000723 000D add [di],cl +00000725 0A00 or al,[bx+si] +00000727 07 pop es +00000728 3030 xor [bx+si],dh +0000072A 3030 xor [bx+si],dh +0000072C 3000 xor [bx+si],al +0000072E 307830 xor [bx+si+0x30],bh +00000731 3030 xor [bx+si],dh +00000733 3000 xor [bx+si],al +00000735 0000 add [bx+si],al +00000737 43 inc bx +00000738 6F outsw +00000739 6E outsb +0000073A 6E outsb +0000073B 65637469 arpl [gs:si+0x69],si +0000073F 6E outsb +00000740 67204150 and [ecx+0x50],al +00000744 4D dec bp +00000745 20496E and [bx+di+0x6e],cl +00000748 7465 jz 0x7af +0000074A 7266 jc 0x7b2 +0000074C 61 popaw +0000074D 63652E arpl [di+0x2e],sp +00000750 2E2E0D0A00 cs or ax,0xa +00000755 50 push ax +00000756 6F outsw +00000757 7765 ja 0x7be +00000759 7269 jc 0x7c4 +0000075B 6E outsb +0000075C 672D6F66 sub ax,0x666f +00000760 662E2E2E0D0A004A cs or eax,0x614a000a + -61 +00000769 7370 jnc 0x7db +0000076B 6F outsw +0000076C 7320 jnc 0x78e +0000076E 6973207265 imul si,[bp+di+0x20],word 0x6572 +00000773 61 popaw +00000774 647920 fs jns 0x797 +00000777 746F jz 0x7e8 +00000779 20706F and [bx+si+0x6f],dh +0000077C 7765 ja 0x7e3 +0000077E 7220 jc 0x7a0 +00000780 6F outsw +00000781 66662C20 o32 sub al,0x20 +00000785 627574 bound si,[di+0x74] +00000788 207468 and [si+0x68],dh +0000078B 6520706F and [gs:bx+si+0x6f],dh +0000078F 7765 ja 0x7f6 +00000791 722D jc 0x7c0 +00000793 6F outsw +00000794 6666206661 o32 and [bp+0x61],ah +00000799 696C65642E imul bp,[si+0x65],word 0x2e64 +0000079E 205379 and [bp+di+0x79],dl +000007A1 7374 jnc 0x817 +000007A3 656D gs insw +000007A5 206861 and [bx+si+0x61],ch +000007A8 7320 jnc 0x7ca +000007AA 626565 bound sp,[di+0x65] +000007AD 6E outsb +000007AE 206861 and [bx+si+0x61],ch +000007B1 6C insb +000007B2 7465 jz 0x819 +000007B4 642E0D0A00 cs or ax,0xa +000007B9 3031 xor [bx+di],dh +000007BB 3233 xor dh,[bp+di] +000007BD 3435 xor al,0x35 +000007BF 3637 ss aaa +000007C1 3839 cmp [bx+di],bh +000007C3 41 inc cx +000007C4 42 inc dx +000007C5 43 inc bx +000007C6 44 inc sp +000007C7 45 inc bp +000007C8 46 inc si +000007C9 45 inc bp +000007CA 7869 js 0x835 +000007CC 7465 jz 0x833 +000007CE 640001 add [fs:bx+di],al +000007D1 0A5368 or dl,[bp+di+0x68] +000007D4 656C gs insb +000007D6 6C insb +000007D7 2028 and [bx+si],ch +000007D9 61 popaw +000007DA 6C insb +000007DB 7068 jo 0x845 +000007DD 61 popaw +000007DE 2920 sub [bx+si],sp +000007E0 010E7D20 add [0x207d],cx +000007E4 0107 add [bx],ax +000007E6 006578 add [di+0x78],ah +000007E9 6974007665 imul si,[si+0x0],word 0x6576 +000007EE 7273 jc 0x863 +000007F0 696F6E0063 imul bp,[bx+0x6e],word 0x6300 +000007F5 6F outsw +000007F6 6D insw +000007F7 7069 jo 0x862 +000007F9 6C insb +000007FA 65206461 and [gs:si+0x61],ah +000007FE 7465 jz 0x865 +00000800 0000 add [bx+si],al +00000802 0201 add al,[bx+di] +00000804 0100 add [bx+si],ax +00000806 02E0 add ah,al +00000808 00400B add [bx+si+0xb],al +0000080B F00900 lock or [bx+si],ax +0000080E 1200 adc al,[bx+si] +00000810 0200 add al,[bx+si] +00000812 0000 add [bx+si],al +00000814 0000 add [bx+si],al +00000816 0000 add [bx+si],al +00000818 0000 add [bx+si],al +0000081A 00 db 0x00 diff --git a/diskio.asm b/diskio.asm index fa1524c..9f915fa 100644 --- a/diskio.asm +++ b/diskio.asm @@ -1,21 +1,126 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Reset the disk system -;; DL must be disk to reset -diskio_ResetDiskSystem: - pop ax - pop dx - push ax - xor ah, ah - int 0x13 - ret -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -diskio_DumpBootSector: - xor bx, bx - mov es, bx - mov bx, diskio_SectorBuffer ; ES:BX = address - mov dl, [Drive] ; DL = Drive number - mov ah, 2 ; AH = Read command - int 0x13 ; Read sector - push diskio_SectorBuffer - call OutText - ret +; Cheers to the BOOT12 bootloader for a lot of these handy definitions. +; Modified them slightly to fit the kernel's needs +;; TO DO: Confirm that these aren't destroyed as kernel loads +;%define s_per_clu 0x7C00+0x0D ; byte Sectors per cluster +;%define s_b4_fat 0x7C00+0x0E ; word Sectors (in partition) before FAT +;%define fats 0x7C00+0x10 ; byte Number of FATs +;%define dir_ent 0x7C00+0x11 ; word Number of root directory entries +;%define s_p_fat 0x7C00+0x16 ; word Sectors per FAT +;%define s_p_t 0x7C00+0x18 ; word Sectors per track +;%define heads 0x7C00+0x1A ; word Number of heads +;%define s_b4_prt 0x7C00+0x1C ; dword Sectors before partition + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; name: jaspos_disk_reset +;; @param disk disk number to reset +;; @return none +;; Resets the disk system +;; +jaspos_disk_reset: + push dx + push ax + mov dl, [Drive] ; DL = drive # + xor ah, ah ; AH = 0 = reset disk system + int 0x13 ; Perform the reset + pop ax + pop dx + ret +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; name: jaspos_disk_readsector +;; @param buffer memory buffer to write sector into +;; @param sector relative sector number to load +;; @return none +;; Loads one sector from the boot disk into memory +;; +jaspos_disk_readsector: + pop bp ; Save CALL's address + pop cx ; Get sector number into CX + pop bx ; Get buffer location + push bp ; Push CALL's address back onto stack ready for RET + + push cx + call jaspos_disk_make_chs ; Convert the sector number supplied into a useful CHS (cylinder, head, sector) triplet + ;mov dl, [Drive] ; DL = Drive number + ;xor dh, dh ; DH = Head + xor ch, ch ; CH = Track number + mov al, 1 ; AL = # Sectors to read + mov ah, 2 ; AH = Read command + int 0x13 ; Read sector + ret +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; name: jaspos_disk_make_chs +;; @param sector relative sector number to load +;; @return CHS registers ready for INT13 +;; Converts relative sector into CHS, ready for +;; interrupt 13 +;; +jaspos_disk_make_chs: + pop bp + pop ax + push bp + + xor dx, dx ; DIV's input is DXAX - clear DX so we're only dividing AX + div word [s_per_track] ; Sectors per track + inc dl ; Sectors start at 1, not 0 + mov cl, dl ; Sectors belong in CL for int 13h + mov ax, bx + + xor dx, dx ; Now calculate the head + div word [s_per_track] ; Sectors per track + + xor dx, dx + div word [heads] ; Floppy sides + mov dh, dl ; Head/side + mov ch, al ; Track + + mov dl, [Drive] ; Set correct device + + ret +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; name: jaspos_disk_get_info +;; @param none +;; @return none +;; Load the boot sector into memory and patches +;; the disk info (label, heads etc) into memory +;; for use by kernel +;; +jaspos_disk_get_info: + call jaspos_disk_reset ; + jc jaspos.panic ; If the reset fails, just panic + + ; We need to call INT13 manually, because jaspos_diskio_readsector + ; relies on having the disk info we're about to load, loaded. + ; Hooray for having to bootstrap + mov bx, free_ram ; Buffer location + mov dl, [Drive] ; DL = Drive number + xor dh, dh ; DH = Head + xor ch, ch ; CH = Track number + mov al, 1 ; AL = # Sectors to read + mov ah, 2 ; AH = Read command + int 0x13 ; Read sector + + mov di, msgDiskLabel + 13 ; Load the disk label into the disk label message + mov si, free_ram+0x2B ; The label starts 0x2B bytes into the sector + mov cx, 11d ; Disk labels are 11 bytes long on FAT12 + rep movsb ; Copy 11 bytes from the sector buffer into the inside of + + mov cx, 25d ; There are 25d bytes that I want copied and saved + mov si, free_ram+0x0B ; Start copying from byte 0x0B + mov di, b_per_s ; Start storing at the b_per_s label + rep movsb ; Copy the bytes + + ret ; the disk label message, thus filling it with the disk label +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/emergencyshell.asm b/emergencyshell.asm new file mode 100644 index 0000000..0824f64 --- /dev/null +++ b/emergencyshell.asm @@ -0,0 +1,68 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + push msgEnteringShell + call jaspos_monitor_dispstring +.eshell: + push msgPrompt + call jaspos_monitor_dispstring ; Show the prompt + + push free_ram ; Buffer = free ram + push 32d ; Max chars to read = 32 + call jaspos_keyb_getstring ; Get a command + + push msgNewLine + call jaspos_monitor_dispstring + + push free_ram + call jaspos_strutils_tolower + + push cmdExit + push free_ram + call jaspos_strutils_compare + jz .quit + + push cmdVersion + push free_ram + call jaspos_strutils_compare + jz .eshell_version + + push cmdCompileDate + push free_ram + call jaspos_strutils_compare + jz .eshell_compiledate + + push cmdOff + push free_ram + call jaspos_strutils_compare + jz .eshell_off + + push cmdHelp + push free_ram + call jaspos_strutils_compare + jz .eshell_help + + + jmp .eshell + + +.eshell_version: + push msgVersion + call jaspos_monitor_dispstring + jmp .eshell + +.eshell_compiledate: + push msgCompileDate + call jaspos_monitor_dispstring + jmp .eshell + +.eshell_off: + call jaspos_power_connect + jmp jaspos_power_shutdown + +.eshell_help: + push msgShellHelp + call jaspos_monitor_dispstring + jmp .eshell + +.quit: \ No newline at end of file diff --git a/kernel.asm b/kernel.asm new file mode 100644 index 0000000..6df25d1 --- /dev/null +++ b/kernel.asm @@ -0,0 +1,83 @@ +%define JASPOS_VERSION "Jaspos Pre Build 1" +%define STACK_SIZE 0xFFFF +; TO DO: Document all functions with parameters, input and output +; o Include full commenting of all instructions in functions. +; Let's get this god damned project into line on the doc +; side and keep it like that + +%include "apijmps.asm" + +jaspos: + mov ax, cs ; AX = code segment + mov ds, ax ; DS = AX = code segment + mov es, ax ; ES = AX = code segment + add ax, 0x1000 ; semgnet(AX) += 1 + mov ss, ax ; SS = code segment + 1 segment + xor dh, dh ; Let's be sure we won't store what crud may be in DH + mov [Drive], dx ; Save the drive number that the bootloader passes to us + mov sp, STACK_SIZE ; Set stack pointer based upon predefined stack size + call jaspos_monitor_clear ; Clear the screen + call jaspos_disk_get_info ; Load the boot disk's info into memory + push msgLoading ; Display a loading message + call jaspos_monitor_dispstring ; + push 0x3000 ; Set the cursor pos for right hand side of screen + call jaspos_monitor_setcursorxy ; Set the cursor position + call jaspos_monitor_updatecursor + push msgPoolClosed ; Print the string + call jaspos_monitor_dispstring ; + call jaspos_bootbanner ; Print our nice banner showing disk number, label etc + +;####################################################################### + + mov ah, 4 + int 0x1A + + mov [free_ram + 4], byte 0 + push free_ram + 3 + push cx + call jaspos_strutils_hex2str + push free_ram + call jaspos_monitor_dispstring + + push free_ram + 3 + push dx + call jaspos_strutils_hex2str + push free_ram + call jaspos_monitor_dispstring + + push msgNewLine + call jaspos_monitor_dispstring + + mov ah, 2 + int 0x1A + + push free_ram + 3 + push cx + call jaspos_strutils_hex2str + push free_ram + call jaspos_monitor_dispstring + + push free_ram + 3 + mov dl, dh + xor dh, dh + push dx + call jaspos_strutils_hex2str + push free_ram + 2 + call jaspos_monitor_dispstring + +;##########