diff --git a/Makefile b/Makefile index d308d0f..2fbf67d 100644 --- a/Makefile +++ b/Makefile @@ -41,8 +41,8 @@ all: # Clean up the source directory of any binaries # ################################################# clean: - cd boot; make clean - cd kernel; make clean + make -C boot clean + make -C kernel clean diff --git a/boot/stage1.bin b/boot/stage1.bin deleted file mode 100644 index a2f0865..0000000 Binary files a/boot/stage1.bin and /dev/null differ diff --git a/boot/stage2.bin b/boot/stage2.bin deleted file mode 100644 index 0f198c0..0000000 Binary files a/boot/stage2.bin and /dev/null differ diff --git a/kernel/kernel.bin b/kernel/kernel.bin deleted file mode 100644 index cb76ed8..0000000 Binary files a/kernel/kernel.bin and /dev/null differ diff --git a/kernel/kio.c b/kernel/kio.c index b949bfe..6b28500 100644 --- a/kernel/kio.c +++ b/kernel/kio.c @@ -172,7 +172,7 @@ void kio_drawConsole() video_rectf(8, 8, 491, 261, 0); video_rect(7, 7, 492, 262, 0x00777777); int x, y; - x = 240, y = 125; + x = 250, y = 135; int s = 100, p = 0; for (p = 0; p <= s; p += 16) { @@ -186,7 +186,7 @@ void kio_drawConsole() { for (y = 0; y < 25; y++) { - video_renderChar(x*6+10, y*10+10, console_memory[y*80+x], 0, 0x00FF9900); + video_renderChar(x*6+10, y*10+10, console_memory[y*80+x], 0, 0x00FFFFFF); } } } @@ -197,7 +197,7 @@ void kio_drawConsoleChar(dword position) { int x = position % 80; int y = position / 80; - video_renderChar(x*6+10, y*10+10, console_memory[y*80+x], 0, 0x00FF9900); + video_renderChar(x*6+10, y*10+10, console_memory[y*80+x], 0, 0x00FFFFFF); } diff --git a/kernel/lst/LDout.doc b/kernel/lst/LDout.doc deleted file mode 100644 index 2e32d55..0000000 --- a/kernel/lst/LDout.doc +++ /dev/null @@ -1,276 +0,0 @@ - -Allocating common symbols -Common symbol size file - -_mouse_y 0x4 mouse.o -_video_mode 0x100 video.o -_console_memory 0xfa0 kio.o -_page_bitmap 0x20000 mm.o -_kbdBuffer 0x100 keyboard.o -_mouse_x 0x4 mouse.o -_mouse_inbuffer 0x10 mouse.o - -Memory Configuration - -Name Origin Length Attributes -*default* 0x0000000000000000 0xffffffffffffffff - -Linker script and memory map - - -.text 0x00000000c0106000 0x4000 - 0x00000000c0106000 code = . - 0x00000000c0106000 _code = . - 0x00000000c0106000 __code = . - *(.text) - .text 0x00000000c0106000 0x384 ks.o - 0x00000000c0106000 _start - .text 0x00000000c0106384 0x552 kernel.o - 0x00000000c0106384 _k_init - 0x00000000c010664d _draw_star - 0x00000000c0106727 _isr - 0x00000000c010655b _star_array - *fill* 0x00000000c01068d6 0x2 00 - .text 0x00000000c01068d8 0x308 asmfuncs.o - 0x00000000c01068f6 _read_cr3 - 0x00000000c01068fa _strcmp - 0x00000000c0106a09 _puts - 0x00000000c0106990 _memsetd - 0x00000000c01069be _invlpg_ - 0x00000000c0106a28 _putDecu - 0x00000000c010694c _memcpyd - 0x00000000c0106935 _memcpy - 0x00000000c0106963 _memset - 0x00000000c01068f2 _read_cr2 - 0x00000000c01069c6 _writeCursorPosition - 0x00000000c0106979 _memsetw - 0x00000000c0106af0 _putDec - 0x00000000c0106920 _strcpy - 0x00000000c01069a6 _strlen - 0x00000000c01069ec _getCursorPosition - 0x00000000c01068d8 _write_cr0 - 0x00000000c01068e7 _write_cr3 - 0x00000000c01068e3 _read_cr0 - .text 0x00000000c0106be0 0x693 keyboard.o - 0x00000000c0107113 _kbdGetKey - 0x00000000c01071a7 _kbd_resetLEDs - 0x00000000c0106be0 _isr_keyboard - 0x00000000c0107164 _kbdWaitKey - *fill* 0x00000000c0107273 0x1 00 - .text 0x00000000c0107274 0x5f9 kio.o - 0x00000000c01077ed _kio_drawConsoleChar - 0x00000000c01073b0 _putc - 0x00000000c01075f9 _kio_console_cls - 0x00000000c01074ec _putHex - 0x00000000c0107596 _kio_console_scroll - 0x00000000c0107652 _kio_drawConsole - 0x00000000c0107274 _printf - 0x00000000c010755f _kio_putBCD - *fill* 0x00000000c010786d 0x3 00 - .text 0x00000000c0107870 0x347 mm.o - 0x00000000c0107a9b _mm_palloc - 0x00000000c0107a51 _mm_pfree - 0x00000000c0107a14 _mm_pfreen - 0x00000000c0107870 _mm_init - 0x00000000c0107b3f _mm_freemem - 0x00000000c0107bad _mm_getTotalMegs - 0x00000000c0107ba3 _mm_getTotalMem - *fill* 0x00000000c0107bb7 0x1 00 - .text 0x00000000c0107bb8 0x1f5 mouse.o - 0x00000000c0107bb8 _mouse_init - 0x00000000c0107c58 _isr_mouse - *fill* 0x00000000c0107dad 0x3 00 - .text 0x00000000c0107db0 0x8d stdfont.o - 0x00000000c0107db0 _stdfont_getFontWidth - 0x00000000c0107ddf _stdfont_getFontHeight - 0x00000000c0107e0e _stdfont_getBitmap - *fill* 0x00000000c0107e3d 0x3 00 - .text 0x00000000c0107e40 0x5cf video.o - 0x00000000c0108289 _video_psetp32 - 0x00000000c0107ec9 _video_renderChar - 0x00000000c01082d8 _video_getPhysBasePtr - 0x00000000c01081ad _video_rectf - 0x00000000c0108083 _video_pseti - 0x00000000c0107e40 _video_init - 0x00000000c01081f5 _video_psetp16 - 0x00000000c0107f85 _video_horiz - 0x00000000c01082ec _video_line - 0x00000000c010823b _video_psetp24 - 0x00000000c01082a4 _video_psetpnull - 0x00000000c0108155 _video_rect - 0x00000000c01082c9 _video_getBitsPerPixel - 0x00000000c010809e _video_vert - 0x00000000c01082a9 _video_getWidth - 0x00000000c01082b9 _video_getHeight - 0x00000000c01082e2 _video_Mode - 0x00000000c010802c _video_pset - *fill* 0x00000000c010840f 0x1 00 - .text 0x00000000c0108410 0x833 vmm.o - 0x00000000c0108a17 _vmm_addHeapEntryBlock - 0x00000000c0108bbe _free - 0x00000000c01086ed _vmm_unmapn - 0x00000000c01086ac _vmm_unmap1 - 0x00000000c0108b08 _vmm_getFirstHoleHeapEntry - 0x00000000c01089fb _vmm_nextHeapEntry - 0x00000000c010859e _vmm_map1 - 0x00000000c010883a _vmm_coalesceHeapEntry - 0x00000000c0108904 _vmm_moreCore - 0x00000000c0108410 _vmm_init - 0x00000000c010871a _malloc - 0x00000000c0108b87 _vmm_heapEntriesLeft - 0x00000000c0108ad9 _vmm_getLastHeapEntry - 0x00000000c0108c08 _vmm_getHeapEntryByBase - 0x00000000c0108523 _vmm_heb_init - 0x00000000c010878d _vmm_getFreeChunk - 0x00000000c0108b4d _vmm_getFirstUnusedHeapEntry - 0x00000000c0108673 _vmm_mapn - *fill* 0x00000000c0108c43 0x1 00 - .text 0x00000000c0108c44 0x25c rtc.o - 0x00000000c0108d3a _rtc_setDay - 0x00000000c0108e39 _rtc_setHour - 0x00000000c0108ce8 _rtc_readMinute - 0x00000000c0108c96 _rtc_readYear - 0x00000000c0108c44 _rtc_readDay - 0x00000000c0108d6d _rtc_setMonth - 0x00000000c0108d11 _rtc_readHour - 0x00000000c0108cbf _rtc_readSecond - 0x00000000c0108da0 _rtc_setYear - 0x00000000c0108dd3 _rtc_setSecond - 0x00000000c0108e06 _rtc_setMinute - 0x00000000c0108c6d _rtc_readMonth - .text 0x00000000c0108ea0 0x120 pic.o - 0x00000000c0108ea0 _pic_remap - .text 0x00000000c0108fc0 0x159 string.o - 0x00000000c0108fc0 _strcat - 0x00000000c0108fe8 _string_split - 0x00000000c0109045 _string_advance - 0x00000000c010909f _ucase - 0x00000000c010905e _rtrim - 0x00000000c01090dc _lcase - *fill* 0x00000000c0109119 0x3 00 - .text 0x00000000c010911c 0xe4 cmos.o - 0x00000000c0109174 _cmos_gethd0 - 0x00000000c010911c _cmos_getfd0 - 0x00000000c01091a0 _cmos_gethd1 - 0x00000000c0109148 _cmos_getfd1 - 0x00000000c010a000 . = ALIGN (0x1000) - *fill* 0x00000000c0109200 0x80b930000000e00 00 - -.data 0x00000000c010a000 0x1000 - 0x00000000c010a000 data = . - 0x00000000c010a000 _data = . - 0x00000000c010a000 __data = . - *(.data) - .data 0x00000000c010a000 0x18 stdfont.o - 0x00000000c010a000 _fonts - .data 0x00000000c010a018 0x10 video.o - 0x00000000c010a018 _vid_ptr16 - 0x00000000c010a024 _video_psetp - 0x00000000c010a020 _vid_ptr32 - 0x00000000c010a01c _vid_ptr24 - .data 0x00000000c010a028 0x4 vmm.o - 0x00000000c010a028 _firstHeapEntry - 0x00000000c010b000 . = ALIGN (0x1000) - *fill* 0x00000000c010a02c 0x80b941400000fd4 00 - -.bss 0x00000000c010b000 0x221c0 - 0x00000000c010b000 bss = . - 0x00000000c010b000 _bss = . - 0x00000000c010b000 __bss = . - *(.bss) - .bss 0x00000000c010b000 0x4 kernel.o - 0x00000000c010b000 _timer - *fill* 0x00000000c010b004 0x4 00 - .bss 0x00000000c010b008 0xf keyboard.o - 0x00000000c010b014 _kbdExt - 0x00000000c010b009 _kbdAscii - 0x00000000c010b015 _kbdExt2 - 0x00000000c010b016 _ackReason - 0x00000000c010b00c _kbdBufferStart - 0x00000000c010b00a _kbdScan - 0x00000000c010b010 _kbdBufferLen - 0x00000000c010b008 _kbdFlags - *fill* 0x00000000c010b017 0x1 00 - .bss 0x00000000c010b018 0x4 kio.o - 0x00000000c010b018 _cursorPosition - .bss 0x00000000c010b01c 0x8 mm.o - 0x00000000c010b020 _mm_megabytes - 0x00000000c010b01c _mm_totalmem - .bss 0x00000000c010b024 0x4 mouse.o - 0x00000000c010b024 _mouse_bytesRead - .bss 0x00000000c010b028 0x4 video.o - 0x00000000c010b028 _videoMode - 0x00000000c010c000 . = ALIGN (0x1000) - *fill* 0x00000000c010b02c 0x80b952800000fd4 00 - COMMON 0x00000000c010c000 0x100 keyboard.o - 0x0 (size before relaxing) - 0x00000000c010c000 _kbdBuffer - COMMON 0x00000000c010c100 0xfa0 kio.o - 0x0 (size before relaxing) - 0x00000000c010c100 _console_memory - COMMON 0x00000000c010d0a0 0x20000 mm.o - 0x0 (size before relaxing) - 0x00000000c010d0a0 _page_bitmap - COMMON 0x00000000c012d0a0 0x18 mouse.o - 0x0 (size before relaxing) - 0x00000000c012d0a0 _mouse_y - 0x00000000c012d0a4 _mouse_x - 0x00000000c012d0a8 _mouse_inbuffer - *fill* 0x00000000c012d0b8 0x80b952800000008 00 - COMMON 0x00000000c012d0c0 0x100 video.o - 0x0 (size before relaxing) - 0x00000000c012d0c0 _video_mode - 0x00000000c012d1c0 end = . - 0x00000000c012d1c0 _end = . - 0x00000000c012d1c0 __end = . -LOAD ks.o -LOAD kernel.o -LOAD asmfuncs.o -LOAD fdc.o -LOAD functions.o -LOAD keyboard.o -LOAD kio.o -LOAD mm.o -LOAD mouse.o -LOAD stdfont.o -LOAD video.o -LOAD vmm.o -LOAD rtc.o -LOAD pic.o -LOAD io.o -LOAD string.o -LOAD cmos.o -OUTPUT(kernel.bin binary) - -.rodata 0x00000000c012d1c0 0x1620 - .rodata 0x00000000c012d1c0 0x101 kernel.o - *fill* 0x00000000c012d2c1 0xa0000001f 00 - .rodata 0x00000000c012d2e0 0x113 keyboard.o - 0x00000000c012d2e0 _SCAN2ASCII - 0x00000000c012d360 _SCAN2ASCIISHIFT - *fill* 0x00000000c012d3f3 0xa00000001 00 - .rodata 0x00000000c012d3f4 0x1e4 kio.o - *fill* 0x00000000c012d5d8 0xa00000008 00 - .rodata 0x00000000c012d5e0 0x1200 stdfont.o - 0x00000000c012d5e0 _stdfont8x5 - 0x00000000c012dde0 _stdfont10x7 - -.note.GNU-stack - 0x0000000000000000 0x0 - -.comment 0x0000000000000000 0x2fd - .comment 0x0000000000000000 0x33 kernel.o - .comment 0x0000000000000033 0x33 fdc.o - .comment 0x0000000000000066 0x33 functions.o - .comment 0x0000000000000099 0x33 keyboard.o - .comment 0x00000000000000cc 0x33 kio.o - .comment 0x00000000000000ff 0x33 mm.o - .comment 0x0000000000000132 0x33 mouse.o - .comment 0x0000000000000165 0x33 stdfont.o - .comment 0x0000000000000198 0x33 video.o - .comment 0x00000000000001cb 0x33 vmm.o - .comment 0x00000000000001fe 0x33 rtc.o - .comment 0x0000000000000231 0x33 pic.o - .comment 0x0000000000000264 0x33 io.o - .comment 0x0000000000000297 0x33 string.o - .comment 0x00000000000002ca 0x33 cmos.o diff --git a/kernel/lst/asmfuncs.lst b/kernel/lst/asmfuncs.lst deleted file mode 100644 index 057c0a2..0000000 --- a/kernel/lst/asmfuncs.lst +++ /dev/null @@ -1,510 +0,0 @@ - 1 ; asmfuncs.asm - 2 ; Josh Holtrop - 3 ; Created: 10/23/03 - 4 ; Modified: 02/26/04 - 5 - 6 [extern _putc] - 7 [extern _console_memory] - 8 [extern _cursorPosition] - 9 [extern _video_drawConsole] - 10 [extern _videoMode] - 11 - 12 %macro jzfar 1 - 13 jnz %%skip - 14 jmp %1 - 15 %%skip: - 16 - 17 %endmacro - 18 - 19 ;stores the parameter to the CR0 register - 20 ;extern dword write_cr0(dword cr0); - 21 [global _write_cr0] - 22 _write_cr0: - 23 00000000 55 push ebp - 24 00000001 89E5 mov ebp, esp - 25 00000003 8B4508 mov eax, [ebp+8] - 26 00000006 0F22C0 mov cr0, eax - 27 00000009 5D pop ebp - 28 0000000A C3 ret - 29 - 30 ;returns the value in the CR0 register - 31 ;extern dword read_cr0(); - 32 [global _read_cr0] - 33 _read_cr0: - 34 0000000B 0F20C0 mov eax, cr0; - 35 0000000E C3 ret - 36 - 37 ;stores the parameter to the CR3 register - 38 ;extern dword write_cr3(dword cr3); - 39 [global _write_cr3] - 40 _write_cr3: - 41 0000000F 55 push ebp - 42 00000010 89E5 mov ebp, esp - 43 00000012 8B4508 mov eax, [ebp+8] - 44 00000015 0F22D8 mov cr3, eax - 45 00000018 5D pop ebp - 46 00000019 C3 ret - 47 - 48 - 49 ;returns the value in the CR2 register - 50 ;extern dword read_cr2(); - 51 [global _read_cr2] - 52 _read_cr2: - 53 0000001A 0F20D0 mov eax, cr2; - 54 0000001D C3 ret - 55 - 56 - 57 - 58 ;returns the value in the CR3 register - 59 ;extern dword read_cr3(); - 60 [global _read_cr3] - 61 _read_cr3: - 62 0000001E 0F20D8 mov eax, cr3; - 63 00000021 C3 ret - 64 - 65 - 66 ;compares one string to another - 67 ;returns 0 if the strings are different - 68 ;extern dword strcmp(char *str1, char *str2); - 69 [global _strcmp] - 70 _strcmp: - 71 00000022 55 push ebp - 72 00000023 89E5 mov ebp, esp - 73 00000025 56 push esi - 74 00000026 57 push edi - 75 - 76 00000027 8B7508 mov esi, [ebp+8] - 77 0000002A 8B7D0C mov edi, [ebp+12] - 78 strcmp_loop1: - 79 0000002D AC lodsb - 80 0000002E 8A27 mov ah, [edi] - 81 00000030 47 inc edi - 82 00000031 38C4 cmp ah, al - 83 00000033 750D jnz strcmp_ne - 84 00000035 08C0 or al, al - 85 00000037 7402 jz strcmp_e - 86 00000039 EBF2 jmp strcmp_loop1 - 87 strcmp_e: - 88 0000003B B801000000 mov eax, 1 - 89 00000040 EB02 jmp short strcmp_done - 90 strcmp_ne: - 91 00000042 31C0 xor eax, eax - 92 strcmp_done: - 93 - 94 00000044 5F pop edi - 95 00000045 5E pop esi - 96 00000046 5D pop ebp - 97 00000047 C3 ret - 98 - 99 ;copies a string from the source to the destination parameter - 100 ;extern void strcpy(char *dest, char *src); - 101 [global _strcpy] - 102 _strcpy: - 103 00000048 55 push ebp - 104 00000049 89E5 mov ebp, esp - 105 0000004B 56 push esi - 106 0000004C 57 push edi - 107 0000004D 8B7D08 mov edi, [ebp+8] - 108 00000050 8B750C mov esi, [ebp+12] - 109 strcpyloop: - 110 00000053 AC lodsb - 111 00000054 AA stosb - 112 00000055 08C0 or al, al - 113 00000057 75FA jnz strcpyloop - 114 00000059 5F pop edi - 115 0000005A 5E pop esi - 116 0000005B 5D pop ebp - 117 0000005C C3 ret - 118 - 119 ;copies memory of n bytes from src to destination - 120 ;void memcpy(void *dest, void *src, dword n); - 121 [global _memcpy] - 122 _memcpy: - 123 0000005D 55 push ebp - 124 0000005E 89E5 mov ebp, esp - 125 00000060 56 push esi - 126 00000061 57 push edi - 127 00000062 51 push ecx - 128 00000063 8B7D08 mov edi, [ebp+8] - 129 00000066 8B750C mov esi, [ebp+12] - 130 00000069 8B4D10 mov ecx, [ebp+16] - 131 - 132 0000006C FC cld - 133 0000006D F3A4 rep movsb - 134 - 135 0000006F 59 pop ecx - 136 00000070 5F pop edi - 137 00000071 5E pop esi - 138 00000072 5D pop ebp - 139 00000073 C3 ret - 140 - 141 - 142 ;copies memory of n dwords (n*4 bytes) from src to destination - 143 ;void memcpyd(void *dest, void *src, dword n); - 144 [global _memcpyd] - 145 _memcpyd: - 146 00000074 55 push ebp - 147 00000075 89E5 mov ebp, esp - 148 00000077 56 push esi - 149 00000078 57 push edi - 150 00000079 51 push ecx - 151 0000007A 8B7D08 mov edi, [ebp+8] - 152 0000007D 8B750C mov esi, [ebp+12] - 153 00000080 8B4D10 mov ecx, [ebp+16] - 154 - 155 00000083 FC cld - 156 00000084 F3A5 rep movsd - 157 - 158 00000086 59 pop ecx - 159 00000087 5F pop edi - 160 00000088 5E pop esi - 161 00000089 5D pop ebp - 162 0000008A C3 ret - 163 - 164 - 165 ;sets num bytes at buffer to the value of c - 166 ;void *memset(void *buffer, int c, int num); - 167 [global _memset] - 168 _memset: - 169 0000008B 55 push ebp - 170 0000008C 89E5 mov ebp, esp - 171 0000008E 57 push edi - 172 0000008F 51 push ecx - 173 00000090 8B7D08 mov edi, [ebp+8] - 174 00000093 57 push edi ;save for return address - 175 00000094 8B450C mov eax, [ebp+12] - 176 00000097 8B4D10 mov ecx, [ebp+16] - 177 - 178 0000009A F3AA rep stosb - 179 - 180 0000009C 58 pop eax - 181 0000009D 59 pop ecx - 182 0000009E 5F pop edi - 183 0000009F 5D pop ebp - 184 000000A0 C3 ret - 185 - 186 - 187 ;sets num words at buffer to the value of c - 188 ;void *memsetw(void *buffer, int c, int num); - 189 [global _memsetw] - 190 _memsetw: - 191 000000A1 55 push ebp - 192 000000A2 89E5 mov ebp, esp - 193 000000A4 57 push edi - 194 000000A5 51 push ecx - 195 000000A6 8B7D08 mov edi, [ebp+8] - 196 000000A9 57 push edi ;save for return address - 197 000000AA 8B450C mov eax, [ebp+12] - 198 000000AD 8B4D10 mov ecx, [ebp+16] - 199 - 200 000000B0 F366AB rep stosw - 201 - 202 000000B3 58 pop eax - 203 000000B4 59 pop ecx - 204 000000B5 5F pop edi - 205 000000B6 5D pop ebp - 206 000000B7 C3 ret - 207 - 208 - 209 ;sets num dwords at buffer to the value of c - 210 ;void *memsetd(void *buffer, int c, int num); - 211 [global _memsetd] - 212 _memsetd: - 213 000000B8 55 push ebp - 214 000000B9 89E5 mov ebp, esp - 215 000000BB 57 push edi - 216 000000BC 51 push ecx - 217 000000BD 8B7D08 mov edi, [ebp+8] - 218 000000C0 57 push edi ;save for return address - 219 000000C1 8B450C mov eax, [ebp+12] - 220 000000C4 8B4D10 mov ecx, [ebp+16] - 221 - 222 000000C7 F3AB rep stosd - 223 - 224 000000C9 58 pop eax - 225 000000CA 59 pop ecx - 226 000000CB 5F pop edi - 227 000000CC 5D pop ebp - 228 000000CD C3 ret - 229 - 230 - 231 ;returns the number of characters in a string - 232 ;extern dword strlen(char *str); - 233 [global _strlen] - 234 _strlen: - 235 000000CE 55 push ebp - 236 000000CF 89E5 mov ebp, esp - 237 000000D1 56 push esi - 238 000000D2 53 push ebx - 239 000000D3 8B7508 mov esi, [ebp+8] - 240 000000D6 31DB xor ebx, ebx - 241 strlenloop: - 242 000000D8 AC lodsb - 243 000000D9 08C0 or al, al - 244 000000DB 7403 jz strlendone - 245 000000DD 43 inc ebx - 246 000000DE EBF8 jmp strlenloop - 247 strlendone: - 248 000000E0 89D8 mov eax, ebx - 249 000000E2 5B pop ebx - 250 000000E3 5E pop esi - 251 000000E4 5D pop ebp - 252 000000E5 C3 ret - 253 - 254 ;this function invalidates the page directory/table entry that - 255 ; would be used to access the memory address given in the parameter - 256 ;extern void invlpg_(dword addr); - 257 [global _invlpg_] - 258 _invlpg_: - 259 000000E6 8B442404 mov eax, [esp+4] - 260 000000EA 0F0138 invlpg [eax] - 261 000000ED C3 ret - 262 - 263 - 264 ; - 265 ;void writeCursorPosition(word pos) - 266 ; - 267 [global _writeCursorPosition] - 268 _writeCursorPosition: - 269 000000EE 55 push ebp - 270 000000EF 89E5 mov ebp, esp - 271 - 272 000000F1 50 push eax - 273 000000F2 53 push ebx - 274 000000F3 52 push edx - 275 - 276 000000F4 8B4508 mov eax, [ebp+8] ;cursor position in ax - 277 - 278 000000F7 88C3 mov bl, al - 279 000000F9 66BAD403 mov dx, 0x03D4 - 280 000000FD B00E mov al, 0x0E - 281 000000FF EE out dx, al - 282 - 283 00000100 6642 inc dx - 284 00000102 88E0 mov al, ah - 285 00000104 EE out dx, al - 286 - 287 00000105 664A dec dx - 288 00000107 B00F mov al, 0x0F - 289 00000109 EE out dx, al - 290 - 291 0000010A 6642 inc dx - 292 0000010C 88D8 mov al, bl - 293 0000010E EE out dx, al - 294 - 295 0000010F 5A pop edx - 296 00000110 5B pop ebx - 297 00000111 58 pop eax - 298 00000112 5D pop ebp - 299 - 300 00000113 C3 ret - 301 - 302 - 303 ; - 304 ;word getCursorPosition() - 305 ; - 306 [global _getCursorPosition] - 307 _getCursorPosition: - 308 00000114 53 push ebx - 309 00000115 52 push edx - 310 - 311 00000116 31C0 xor eax, eax - 312 00000118 66BAD403 mov dx, 0x03D4 - 313 0000011C B00E mov al, 0x0E - 314 0000011E EE out dx, al - 315 - 316 0000011F 6642 inc dx - 317 00000121 EC in al, dx - 318 00000122 88C3 mov bl, al - 319 - 320 00000124 664A dec dx - 321 00000126 B00F mov al, 0x0F - 322 00000128 EE out dx, al - 323 - 324 00000129 6642 inc dx - 325 0000012B EC in al, dx - 326 0000012C 88DC mov ah, bl - 327 - 328 0000012E 5A pop edx - 329 0000012F 5B pop ebx - 330 - 331 00000130 C3 ret - 332 - 333 - 334 ; - 335 ;int puts(char *str) - 336 ; - 337 [global _puts] - 338 _puts: - 339 00000131 55 push ebp - 340 00000132 89E5 mov ebp, esp - 341 00000134 56 push esi - 342 00000135 50 push eax - 343 00000136 8B7508 mov esi, [ebp+8] ;esi = to string - 344 puts_loop: - 345 00000139 AC lodsb - 346 0000013A 3C00 cmp al, 0 - 347 0000013C 740E jz puts_done - 348 0000013E 50 push eax - 349 0000013F E8(00000000) call _putc - 350 00000144 81C404000000 add esp, 4 - 351 0000014A EBED jmp puts_loop - 352 - 353 puts_done: - 354 0000014C 58 pop eax - 355 0000014D 5E pop esi - 356 0000014E 5D pop ebp - 357 0000014F C3 ret - 358 - 359 - 360 - 361 - 362 [global _putDecu] - 363 _putDecu: - 364 00000150 55 push ebp - 365 00000151 89E5 mov ebp, esp - 366 00000153 81EC18000000 sub esp, 24 - 367 00000159 C745FC01000000 mov DWORD [ebp-4], 1 - 368 00000160 C645FB00 mov BYTE [ebp-5], 0 - 369 L2: - 370 00000164 8B5508 mov edx, DWORD [ebp+8] - 371 00000167 B8CDCCCCCC mov eax, -858993459 - 372 0000016C F7E2 mul edx - 373 0000016E 89D0 mov eax, edx - 374 00000170 C1E803 shr eax, 3 - 375 00000173 3B45FC cmp eax, DWORD [ebp-4] - 376 00000176 7305 jae L4 - 377 00000178 E912000000 jmp L3 - 378 L4: - 379 0000017D 8B45FC mov eax, DWORD [ebp-4] - 380 00000180 89C2 mov edx, eax - 381 00000182 C1E202 sal edx, 2 - 382 00000185 01C2 add edx, eax - 383 00000187 8D0412 lea eax, [edx+edx] - 384 0000018A 8945FC mov DWORD [ebp-4], eax - 385 0000018D EBD5 jmp L2 - 386 L3: - 387 0000018F 90 nop - 388 L5: - 389 00000190 817DFC01000000 cmp DWORD [ebp-4], 1 - 390 00000197 7705 ja L7 - 391 00000199 E959000000 jmp L6 - 392 L7: - 393 0000019E 8B5508 mov edx, DWORD [ebp+8] - 394 000001A1 89D0 mov eax, edx - 395 000001A3 BA00000000 mov edx, 0 - 396 000001A8 F775FC div DWORD [ebp-4] - 397 000001AB 8945F4 mov DWORD [ebp-12], eax - 398 000001AE 8A45F4 mov al, BYTE [ebp-12] - 399 000001B1 8845FB mov BYTE [ebp-5], al - 400 000001B4 B800000000 mov eax, 0 - 401 000001B9 8A45FB mov al, BYTE [ebp-5] - 402 000001BC 0FAF45FC imul eax, DWORD [ebp-4] - 403 000001C0 294508 sub DWORD [ebp+8], eax - 404 000001C3 8B55FC mov edx, DWORD [ebp-4] - 405 000001C6 B8CDCCCCCC mov eax, -858993459 - 406 000001CB F7E2 mul edx - 407 000001CD 89D0 mov eax, edx - 408 000001CF C1E803 shr eax, 3 - 409 000001D2 8945FC mov DWORD [ebp-4], eax - 410 000001D5 8D45FB lea eax, [ebp-5] - 411 000001D8 800030 add BYTE [eax], 48 - 412 000001DB 81EC0C000000 sub esp, 12 - 413 000001E1 B800000000 mov eax, 0 - 414 000001E6 8A45FB mov al, BYTE [ebp-5] - 415 000001E9 50 push eax - 416 000001EA E8(00000000) call _putc - 417 000001EF 81C410000000 add esp, 16 - 418 000001F5 EB99 jmp L5 - 419 L6: - 420 000001F7 81EC0C000000 sub esp, 12 - 421 000001FD 8A4508 mov al, BYTE [ebp+8] - 422 00000200 0530000000 add eax, 48 - 423 00000205 25FF000000 and eax, 255 - 424 0000020A 50 push eax - 425 0000020B E8(00000000) call _putc - 426 00000210 81C410000000 add esp, 16 - 427 00000216 C9 leave - 428 00000217 C3 ret - 429 - 430 - 431 - 432 - 433 [global _putDec] - 434 _putDec: - 435 00000218 55 push ebp - 436 00000219 89E5 mov ebp, esp - 437 0000021B 81EC18000000 sub esp, 24 - 438 00000221 817D0800000000 cmp DWORD [ebp+8], 0 - 439 00000228 7919 jns L9 - 440 0000022A 81EC0C000000 sub esp, 12 - 441 00000230 682D000000 push 45 - 442 00000235 E8(00000000) call _putc - 443 0000023A 81C410000000 add esp, 16 - 444 00000240 F75D08 neg DWORD [ebp+8] - 445 L9: - 446 00000243 C745FC01000000 mov DWORD [ebp-4], 1 - 447 0000024A C645FB00 mov BYTE [ebp-5], 0 - 448 L10: - 449 0000024E 8B4508 mov eax, DWORD [ebp+8] - 450 00000251 3B45FC cmp eax, DWORD [ebp-4] - 451 00000254 7305 jae L12 - 452 00000256 E912000000 jmp L11 - 453 L12: - 454 0000025B 8B45FC mov eax, DWORD [ebp-4] - 455 0000025E 89C2 mov edx, eax - 456 00000260 C1E202 sal edx, 2 - 457 00000263 01C2 add edx, eax - 458 00000265 8D0412 lea eax, [edx+edx] - 459 00000268 8945FC mov DWORD [ebp-4], eax - 460 0000026B EBE1 jmp L10 - 461 L11: - 462 0000026D 8B55FC mov edx, DWORD [ebp-4] - 463 00000270 B8CDCCCCCC mov eax, -858993459 - 464 00000275 F7E2 mul edx - 465 00000277 89D0 mov eax, edx - 466 00000279 C1E803 shr eax, 3 - 467 0000027C 8945FC mov DWORD [ebp-4], eax - 468 L13: - 469 0000027F 817DFC01000000 cmp DWORD [ebp-4], 1 - 470 00000286 7705 ja L15 - 471 00000288 E959000000 jmp L14 - 472 L15: - 473 0000028D 8B5508 mov edx, DWORD [ebp+8] - 474 00000290 89D0 mov eax, edx - 475 00000292 BA00000000 mov edx, 0 - 476 00000297 F775FC div DWORD [ebp-4] - 477 0000029A 8945F4 mov DWORD [ebp-12], eax - 478 0000029D 8A45F4 mov al, BYTE [ebp-12] - 479 000002A0 8845FB mov BYTE [ebp-5], al - 480 000002A3 B800000000 mov eax, 0 - 481 000002A8 8A45FB mov al, BYTE [ebp-5] - 482 000002AB 0FAF45FC imul eax, DWORD [ebp-4] - 483 000002AF 294508 sub DWORD [ebp+8], eax - 484 000002B2 8B55FC mov edx, DWORD [ebp-4] - 485 000002B5 B8CDCCCCCC mov eax, -858993459 - 486 000002BA F7E2 mul edx - 487 000002BC 89D0 mov eax, edx - 488 000002BE C1E803 shr eax, 3 - 489 000002C1 8945FC mov DWORD [ebp-4], eax - 490 000002C4 8D45FB lea eax, [ebp-5] - 491 000002C7 800030 add BYTE [eax], 48 - 492 000002CA 81EC0C000000 sub esp, 12 - 493 000002D0 B800000000 mov eax, 0 - 494 000002D5 8A45FB mov al, BYTE [ebp-5] - 495 000002D8 50 push eax - 496 000002D9 E8(00000000) call _putc - 497 000002DE 81C410000000 add esp, 16 - 498 000002E4 EB99 jmp L13 - 499 L14: - 500 000002E6 81EC0C000000 sub esp, 12 - 501 000002EC 8A4508 mov al, BYTE [ebp+8] - 502 000002EF 0530000000 add eax, 48 - 503 000002F4 25FF000000 and eax, 255 - 504 000002F9 50 push eax - 505 000002FA E8(00000000) call _putc - 506 000002FF 81C410000000 add esp, 16 - 507 00000305 C9 leave - 508 00000306 C3 ret - 509 - 510 diff --git a/kernel/lst/kernel.lst b/kernel/lst/kernel.lst deleted file mode 100644 index fc1ce68..0000000 --- a/kernel/lst/kernel.lst +++ /dev/null @@ -1,492 +0,0 @@ - 1 ;kernel.asm - 2 ;Author: Josh Holtrop - 3 ;Date: 10/30/03 - 4 ;Modified: 10/30/03 - 5 - 6 %define GDT_P 0x100000; ;1mb physical - Global Descriptor Table space - 7 %define GDT_V GDT_P+0xC0000000 - 8 %define IDT_P 0x102000 ;1mb+8kb - Interrupt Descriptor Table space - 9 %define IDT_V IDT_P+0xC0000000 - 10 %define PDBR_P 0x104000 ;1mb+16kb - Page Directory Base Register (first PD) - 11 %define PDBR_V PDBR_P+0xC0000000 - 12 %define LOPT_P 0x105000 ;1mb+20kb - LOw Page Table for mapping first 4mb - 13 %define LOPT_V LOPT_P+0xC0000000 - 14 %define KERNEL_P 0x106000 ;1mb+24kb - the kernel's physical address - 15 %define KERNEL_V KERNEL_P+0xC0000000 ;3gb+1mb+24kb, the virtual address of the kernel - 16 - 17 [global _start] - 18 [extern _isr] - 19 [extern _k_init] - 20 [extern _putc] - 21 - 22 bits 32 - 23 - 24 ;This is where the kernel begins execution - 25 ;At this point, the temporary gdt is set up to "map" 0xC000_0000 to 0x0. - 26 ;We must enable paging with the first 4mb mapped 1:1 virtual:physical - 27 ; and with the 4mb starting at 0xC000_0000 mapped to the first 4mb physical. - 28 ;Then we can start using our "real" gdt, then unmap the lower 4mb. - 29 _start: - 30 00000000 FA cli ;if they weren't already off - 31 - 32 00000001 31C0 xor eax, eax - 33 00000003 BF004010C0 mov edi, PDBR_V - 34 00000008 B900040000 mov ecx, 1024 ;clear the PDBR - 35 0000000D F3AB rep stosd - 36 0000000F C705004010C0035010- mov [PDBR_V], dword LOPT_P|0x03 ;store the physical address of the LOw Page Table (read/write, present) - 37 00000018 00 - 38 00000019 C705004C10C0035010- mov [PDBR_V+0xC00], dword LOPT_P|0x03 ;store the physical address of the LOw Page Table (read/write, present) - 39 00000022 00 - 40 - 41 00000023 BF005010C0 mov edi, LOPT_V - 42 00000028 B900040000 mov ecx, 1024 - 43 0000002D B803000000 mov eax, 0x03 ;starting physical address = 0x0 (read/write, present flags) - 44 fill_lopt_loop: ;fill the page table - 45 00000032 AB stosd - 46 00000033 0500100000 add eax, 4096 ;increment next phsyical address by 4kb - 47 00000038 E2F8 loop fill_lopt_loop - 48 - 49 0000003A B800401000 mov eax, PDBR_P - 50 0000003F 0F22D8 mov cr3, eax ;store the Page Directory Base Address - 51 00000042 0F20C0 mov eax, cr0 - 52 00000045 0D00000080 or eax, 0x80000000 ;set page enable bit - 53 0000004A 0F22C0 mov cr0, eax ;now paging is active! - 54 - 55 - 56 0000004D BF000010C0 mov edi, GDT_V - 57 00000052 BE[D4000000] mov esi, gdt - 58 00000057 B948000000 mov ecx, gdt_end-gdt - 59 copy_gdt: - 60 0000005C AC lodsb - 61 0000005D AA stosb - 62 0000005E E2FC loop copy_gdt - 63 - 64 00000060 BF002010C0 mov edi, IDT_V ;destination - 65 00000065 BE[22010000] mov esi, isr_0 ;address of isr0 - 66 0000006A BA0B000000 mov edx, isr_1-isr_0 ;distance between isr labels - 67 0000006F B932000000 mov ecx, 50 ;number of isrlabels - 68 fill_idt: - 69 00000074 89F3 mov ebx, esi - 70 00000076 6689F0 mov ax, si - 71 00000079 66AB stosw ;0 offset 15:0 - 72 0000007B 66B80800 mov ax, KERNEL_CODE - 73 0000007F 66AB stosw ;2 selector 15:0 - 74 00000081 66B8008E mov ax, 0x8E00 - 75 00000085 66AB stosw ;4 [P][DPL][0][TYPE][0][0][0][0][0][0][0][0] - 76 00000087 C1EE10 shr esi, 16 - 77 0000008A 6689F0 mov ax, si - 78 0000008D 66AB stosw ;6 offset 31:16 - 79 0000008F 89DE mov esi, ebx - 80 00000091 01D6 add esi, edx - 81 00000093 E2DF loop fill_idt - 82 00000095 66C705842110C000EE mov word [IDT_V+0x30*8+4], 0xEE00 ;interrupt 0x30 has user priviledges - 83 - 84 0000009E 0F0115[CE000000] lgdt [gdtr] ;load gdt - 85 000000A5 EA[AC000000]0800 jmp KERNEL_CODE:newgdtcontinue - 86 newgdtcontinue: - 87 000000AC 66B81000 mov ax, KERNEL_DATA - 88 000000B0 8EC0 mov es, ax - 89 000000B2 8ED8 mov ds, ax - 90 000000B4 8EE8 mov gs, ax - 91 000000B6 8EE0 mov fs, ax - 92 000000B8 8ED0 mov ss, ax - 93 000000BA BC000020C0 mov esp, 0xc0200000 ;stack just under 3gb+2mb, moves downward - 94 000000BF 0F011D[1C010000] lidt [idtr] ;load idt - 95 - 96 000000C6 E8(00000000) call _k_init - 97 haltit: - 98 000000CB F4 hlt ;halt processor when k_init is done - 99 000000CC EBFD jmp haltit ;shouldn't get here... - 100 - 101 %include "gdt.inc" - 102 <1> ;gdt.inc - 103 <1> ;Author: Josh Holtrop - 104 <1> ;Date: 10/30/03 - 105 <1> ;Modified: 03/02/04 - 106 <1> - 107 <1> gdtr: - 108 000000CE 4700 <1> dw gdt_end-gdt-1 - 109 000000D0 000010C0 <1> dd GDT_V - 110 <1> gdt: - 111 000000D4 00000000 <1> dd 0 - 112 000000D8 00000000 <1> dd 0 - 113 <1> KERNEL_CODE equ $-gdt - 114 000000DC FFFF <1> dw 0xffff ;limit 15:0 - 115 000000DE 0000 <1> dw 0x0000 ;base 15:0 - 116 000000E0 00 <1> db 0x00 ;base 23:16 - 117 000000E1 9A <1> db 0x9A ;access ([P][DPL][1][Executable][Direction/Conforming][Writable/Readable][A]) - 118 000000E2 CF <1> db 0xCF ;flags ([G][D/B][0][0]) / limit 19:16 - 119 000000E3 00 <1> db 0x00 ;base 31:24 - 120 <1> KERNEL_DATA equ $-gdt - 121 000000E4 FFFF <1> dw 0xffff ;limit 15:0 - 122 000000E6 0000 <1> dw 0x0000 ;base 15:0 - 123 000000E8 00 <1> db 0x00 ;base 23:16 - 124 000000E9 92 <1> db 0x92 ;access ([P][DPL][1][Executable][Direction/Conforming][Writable/Readable][A]) - 125 000000EA CF <1> db 0xCF ;flags ([G][D/B][0][0]) / limit 19:16 - 126 000000EB 00 <1> db 0x00 ;base 31:24 - 127 <1> USER_CODE equ $-gdt - 128 000000EC FFFF <1> dw 0xffff ;limit 15:0 - 129 000000EE 0000 <1> dw 0x0000 ;base 15:0 - 130 000000F0 00 <1> db 0x00 ;base 23:16 - 131 000000F1 FA <1> db 0xFA ;access ([P][DPL][1][Executable][Direction/Conforming][Writable/Readable][A]) - 132 000000F2 CF <1> db 0xCF ;flags ([G][D/B][0][0]) / limit 19:16 - 133 000000F3 00 <1> db 0x00 ;base 31:24 - 134 <1> USER_DATA equ $-gdt - 135 000000F4 FFFF <1> dw 0xffff ;limit 15:0 - 136 000000F6 0000 <1> dw 0x0000 ;base 15:0 - 137 000000F8 00 <1> db 0x00 ;base 23:16 - 138 000000F9 F2 <1> db 0xF2 ;access ([P][DPL][1][Executable][Direction/Conforming][Writable/Readable][A]) - 139 000000FA CF <1> db 0xCF ;flags ([G][D/B][0][0]) / limit 19:16 - 140 000000FB 00 <1> db 0x00 ;base 31:24 - 141 <1> gVESA_CODE equ $-gdt - 142 000000FC FFFF <1> dw 0xffff ;limit 15:0 - 143 000000FE 0000 <1> dw 0x0000 ;base 15:0 - 144 00000100 00 <1> db 0x00 ;base 23:16 - 145 00000101 9A <1> db 0x9A ;access ([P][DPL][1][Executable][Direction/Conforming][Writable/Readable][A]) - 146 00000102 40 <1> db 0x40 ;flags ([G][D/B][0][0]) / limit 19:16 - 147 00000103 00 <1> db 0x00 ;base 31:24 - 148 <1> VESA_DATA equ $-gdt - 149 00000104 FFFF <1> dw 0xffff ;limit 15:0 - 150 00000106 0000 <1> dw 0x0000 ;base 15:0 - 151 00000108 00 <1> db 0x00 ;base 23:16 - 152 00000109 92 <1> db 0x92 ;access ([P][DPL][1][Executable][Direction/Conforming][Writable/Readable][A]) - 153 0000010A 40 <1> db 0x40 ;flags ([G][D/B][0][0]) / limit 19:16 - 154 0000010B 00 <1> db 0x00 ;base 31:24 - 155 <1> VIDEO_TEXT equ $-gdt - 156 0000010C FF7F <1> dw 0x7FFF ;limit 15:0 - 157 0000010E 0080 <1> dw 0x8000 ;base 15:0 - 158 00000110 0B <1> db 0x0B ;base 23:16 - 159 00000111 92 <1> db 0x92 ;access ([P][DPL][1][Executable][Direction/Conforming][Writable/Readable][A]) - 160 00000112 40 <1> db 0x40 ;flags ([G][D/B][0][0]) / limit 19:16 - 161 00000113 00 <1> db 0x00 ;base 31:24 - 162 <1> VIDEO_GRAPHICS equ $-gdt - 163 00000114 FFFF <1> dw 0xFFFF ;limit 15:0 - 164 00000116 0000 <1> dw 0x0000 ;base 15:0 - 165 00000118 0A <1> db 0x0A ;base 23:16 - 166 00000119 92 <1> db 0x92 ;access ([P][DPL][1][Executable][Direction/Conforming][Writable/Readable][A]) - 167 0000011A 40 <1> db 0x40 ;flags ([G][D/B][0][0]) / limit 19:16 - 168 0000011B 00 <1> db 0x00 ;base 31:24 - 169 <1> gdt_end: - 170 <1> - 171 <1> - 172 <1> - 173 %include "idt.inc" - 174 <1> ;idt.inc - 175 <1> ;Author: Josh Holtrop - 176 <1> ;Date: 10/30/03 - 177 <1> ;Modified: 03/02/04 - 178 <1> - 179 <1> idtr: - 180 0000011C 8F01 <1> dw 50*8-1 ;size of idt - 181 0000011E 002010C0 <1> dd IDT_V ;address of idt - 182 <1> - 183 <1> - 184 <1> %macro isr_label 1 - 185 <1> isr_%1: - 186 <1> push eax - 187 <1> mov eax, %1 - 188 <1> jmp isr_main - 189 <1> %endmacro - 190 <1> - 191 <1> isr_label 0 - 192 <2> isr_%1: - 193 00000122 50 <2> push eax - 194 00000123 B800000000 <2> mov eax, %1 - 195 00000128 E91B020000 <2> jmp isr_main - 196 <1> isr_label 1 - 197 <2> isr_%1: - 198 0000012D 50 <2> push eax - 199 0000012E B801000000 <2> mov eax, %1 - 200 00000133 E910020000 <2> jmp isr_main - 201 <1> isr_label 2 - 202 <2> isr_%1: - 203 00000138 50 <2> push eax - 204 00000139 B802000000 <2> mov eax, %1 - 205 0000013E E905020000 <2> jmp isr_main - 206 <1> isr_label 3 - 207 <2> isr_%1: - 208 00000143 50 <2> push eax - 209 00000144 B803000000 <2> mov eax, %1 - 210 00000149 E9FA010000 <2> jmp isr_main - 211 <1> isr_label 4 - 212 <2> isr_%1: - 213 0000014E 50 <2> push eax - 214 0000014F B804000000 <2> mov eax, %1 - 215 00000154 E9EF010000 <2> jmp isr_main - 216 <1> isr_label 5 - 217 <2> isr_%1: - 218 00000159 50 <2> push eax - 219 0000015A B805000000 <2> mov eax, %1 - 220 0000015F E9E4010000 <2> jmp isr_main - 221 <1> isr_label 6 - 222 <2> isr_%1: - 223 00000164 50 <2> push eax - 224 00000165 B806000000 <2> mov eax, %1 - 225 0000016A E9D9010000 <2> jmp isr_main - 226 <1> isr_label 7 - 227 <2> isr_%1: - 228 0000016F 50 <2> push eax - 229 00000170 B807000000 <2> mov eax, %1 - 230 00000175 E9CE010000 <2> jmp isr_main - 231 <1> isr_label 8 - 232 <2> isr_%1: - 233 0000017A 50 <2> push eax - 234 0000017B B808000000 <2> mov eax, %1 - 235 00000180 E9C3010000 <2> jmp isr_main - 236 <1> isr_label 9 - 237 <2> isr_%1: - 238 00000185 50 <2> push eax - 239 00000186 B809000000 <2> mov eax, %1 - 240 0000018B E9B8010000 <2> jmp isr_main - 241 <1> isr_label 10 - 242 <2> isr_%1: - 243 00000190 50 <2> push eax - 244 00000191 B80A000000 <2> mov eax, %1 - 245 00000196 E9AD010000 <2> jmp isr_main - 246 <1> isr_label 11 - 247 <2> isr_%1: - 248 0000019B 50 <2> push eax - 249 0000019C B80B000000 <2> mov eax, %1 - 250 000001A1 E9A2010000 <2> jmp isr_main - 251 <1> isr_label 12 - 252 <2> isr_%1: - 253 000001A6 50 <2> push eax - 254 000001A7 B80C000000 <2> mov eax, %1 - 255 000001AC E997010000 <2> jmp isr_main - 256 <1> isr_label 13 - 257 <2> isr_%1: - 258 000001B1 50 <2> push eax - 259 000001B2 B80D000000 <2> mov eax, %1 - 260 000001B7 E98C010000 <2> jmp isr_main - 261 <1> isr_label 14 - 262 <2> isr_%1: - 263 000001BC 50 <2> push eax - 264 000001BD B80E000000 <2> mov eax, %1 - 265 000001C2 E981010000 <2> jmp isr_main - 266 <1> isr_label 15 - 267 <2> isr_%1: - 268 000001C7 50 <2> push eax - 269 000001C8 B80F000000 <2> mov eax, %1 - 270 000001CD E976010000 <2> jmp isr_main - 271 <1> isr_label 16 - 272 <2> isr_%1: - 273 000001D2 50 <2> push eax - 274 000001D3 B810000000 <2> mov eax, %1 - 275 000001D8 E96B010000 <2> jmp isr_main - 276 <1> isr_label 17 - 277 <2> isr_%1: - 278 000001DD 50 <2> push eax - 279 000001DE B811000000 <2> mov eax, %1 - 280 000001E3 E960010000 <2> jmp isr_main - 281 <1> isr_label 18 - 282 <2> isr_%1: - 283 000001E8 50 <2> push eax - 284 000001E9 B812000000 <2> mov eax, %1 - 285 000001EE E955010000 <2> jmp isr_main - 286 <1> isr_label 19 - 287 <2> isr_%1: - 288 000001F3 50 <2> push eax - 289 000001F4 B813000000 <2> mov eax, %1 - 290 000001F9 E94A010000 <2> jmp isr_main - 291 <1> isr_label 20 - 292 <2> isr_%1: - 293 000001FE 50 <2> push eax - 294 000001FF B814000000 <2> mov eax, %1 - 295 00000204 E93F010000 <2> jmp isr_main - 296 <1> isr_label 21 - 297 <2> isr_%1: - 298 00000209 50 <2> push eax - 299 0000020A B815000000 <2> mov eax, %1 - 300 0000020F E934010000 <2> jmp isr_main - 301 <1> isr_label 22 - 302 <2> isr_%1: - 303 00000214 50 <2> push eax - 304 00000215 B816000000 <2> mov eax, %1 - 305 0000021A E929010000 <2> jmp isr_main - 306 <1> isr_label 23 - 307 <2> isr_%1: - 308 0000021F 50 <2> push eax - 309 00000220 B817000000 <2> mov eax, %1 - 310 00000225 E91E010000 <2> jmp isr_main - 311 <1> isr_label 24 - 312 <2> isr_%1: - 313 0000022A 50 <2> push eax - 314 0000022B B818000000 <2> mov eax, %1 - 315 00000230 E913010000 <2> jmp isr_main - 316 <1> isr_label 25 - 317 <2> isr_%1: - 318 00000235 50 <2> push eax - 319 00000236 B819000000 <2> mov eax, %1 - 320 0000023B E908010000 <2> jmp isr_main - 321 <1> isr_label 26 - 322 <2> isr_%1: - 323 00000240 50 <2> push eax - 324 00000241 B81A000000 <2> mov eax, %1 - 325 00000246 E9FD000000 <2> jmp isr_main - 326 <1> isr_label 27 - 327 <2> isr_%1: - 328 0000024B 50 <2> push eax - 329 0000024C B81B000000 <2> mov eax, %1 - 330 00000251 E9F2000000 <2> jmp isr_main - 331 <1> isr_label 28 - 332 <2> isr_%1: - 333 00000256 50 <2> push eax - 334 00000257 B81C000000 <2> mov eax, %1 - 335 0000025C E9E7000000 <2> jmp isr_main - 336 <1> isr_label 29 - 337 <2> isr_%1: - 338 00000261 50 <2> push eax - 339 00000262 B81D000000 <2> mov eax, %1 - 340 00000267 E9DC000000 <2> jmp isr_main - 341 <1> isr_label 30 - 342 <2> isr_%1: - 343 0000026C 50 <2> push eax - 344 0000026D B81E000000 <2> mov eax, %1 - 345 00000272 E9D1000000 <2> jmp isr_main - 346 <1> isr_label 31 - 347 <2> isr_%1: - 348 00000277 50 <2> push eax - 349 00000278 B81F000000 <2> mov eax, %1 - 350 0000027D E9C6000000 <2> jmp isr_main - 351 <1> isr_label 32 - 352 <2> isr_%1: - 353 00000282 50 <2> push eax - 354 00000283 B820000000 <2> mov eax, %1 - 355 00000288 E9BB000000 <2> jmp isr_main - 356 <1> isr_label 33 - 357 <2> isr_%1: - 358 0000028D 50 <2> push eax - 359 0000028E B821000000 <2> mov eax, %1 - 360 00000293 E9B0000000 <2> jmp isr_main - 361 <1> isr_label 34 - 362 <2> isr_%1: - 363 00000298 50 <2> push eax - 364 00000299 B822000000 <2> mov eax, %1 - 365 0000029E E9A5000000 <2> jmp isr_main - 366 <1> isr_label 35 - 367 <2> isr_%1: - 368 000002A3 50 <2> push eax - 369 000002A4 B823000000 <2> mov eax, %1 - 370 000002A9 E99A000000 <2> jmp isr_main - 371 <1> isr_label 36 - 372 <2> isr_%1: - 373 000002AE 50 <2> push eax - 374 000002AF B824000000 <2> mov eax, %1 - 375 000002B4 E98F000000 <2> jmp isr_main - 376 <1> isr_label 37 - 377 <2> isr_%1: - 378 000002B9 50 <2> push eax - 379 000002BA B825000000 <2> mov eax, %1 - 380 000002BF E984000000 <2> jmp isr_main - 381 <1> isr_label 38 - 382 <2> isr_%1: - 383 000002C4 50 <2> push eax - 384 000002C5 B826000000 <2> mov eax, %1 - 385 000002CA E979000000 <2> jmp isr_main - 386 <1> isr_label 39 - 387 <2> isr_%1: - 388 000002CF 50 <2> push eax - 389 000002D0 B827000000 <2> mov eax, %1 - 390 000002D5 E96E000000 <2> jmp isr_main - 391 <1> isr_label 40 - 392 <2> isr_%1: - 393 000002DA 50 <2> push eax - 394 000002DB B828000000 <2> mov eax, %1 - 395 000002E0 E963000000 <2> jmp isr_main - 396 <1> isr_label 41 - 397 <2> isr_%1: - 398 000002E5 50 <2> push eax - 399 000002E6 B829000000 <2> mov eax, %1 - 400 000002EB E958000000 <2> jmp isr_main - 401 <1> isr_label 42 - 402 <2> isr_%1: - 403 000002F0 50 <2> push eax - 404 000002F1 B82A000000 <2> mov eax, %1 - 405 000002F6 E94D000000 <2> jmp isr_main - 406 <1> isr_label 43 - 407 <2> isr_%1: - 408 000002FB 50 <2> push eax - 409 000002FC B82B000000 <2> mov eax, %1 - 410 00000301 E942000000 <2> jmp isr_main - 411 <1> isr_label 44 - 412 <2> isr_%1: - 413 00000306 50 <2> push eax - 414 00000307 B82C000000 <2> mov eax, %1 - 415 0000030C E937000000 <2> jmp isr_main - 416 <1> isr_label 45 - 417 <2> isr_%1: - 418 00000311 50 <2> push eax - 419 00000312 B82D000000 <2> mov eax, %1 - 420 00000317 E92C000000 <2> jmp isr_main - 421 <1> isr_label 46 - 422 <2> isr_%1: - 423 0000031C 50 <2> push eax - 424 0000031D B82E000000 <2> mov eax, %1 - 425 00000322 E921000000 <2> jmp isr_main - 426 <1> isr_label 47 - 427 <2> isr_%1: - 428 00000327 50 <2> push eax - 429 00000328 B82F000000 <2> mov eax, %1 - 430 0000032D E916000000 <2> jmp isr_main - 431 <1> isr_label 48 - 432 <2> isr_%1: - 433 00000332 50 <2> push eax - 434 00000333 B830000000 <2> mov eax, %1 - 435 00000338 E90B000000 <2> jmp isr_main - 436 <1> isr_label 49 - 437 <2> isr_%1: - 438 0000033D 50 <2> push eax - 439 0000033E B831000000 <2> mov eax, %1 - 440 00000343 E900000000 <2> jmp isr_main - 441 <1> - 442 <1> isr_main: - 443 00000348 3D30000000 <1> cmp eax, 0x30 - 444 0000034D 7414 <1> jz isr_syscall - 445 <1> - 446 0000034F 60 <1> pusha - 447 00000350 1E <1> push ds - 448 00000351 06 <1> push es - 449 <1> - 450 00000352 50 <1> push eax - 451 <1> - 452 00000353 E8(00000000) <1> call _isr - 453 <1> - 454 00000358 81C404000000 <1> add esp, 4 - 455 <1> - 456 0000035E 07 <1> pop es - 457 0000035F 1F <1> pop ds - 458 00000360 61 <1> popa - 459 00000361 58 <1> pop eax - 460 <1> - 461 00000362 CF <1> iret - 462 <1> - 463 <1> - 464 <1> isr_syscall: - 465 00000363 58 <1> pop eax ;syscall function number - 466 00000364 60 <1> pusha - 467 00000365 1E <1> push ds - 468 00000366 06 <1> push es - 469 <1> - 470 <1> sc1: - 471 00000367 3D01000000 <1> cmp eax, 1 ;syscall 1 - putc - 472 0000036C 7511 <1> jnz sc2 - 473 0000036E 53 <1> push ebx - 474 0000036F E8(00000000) <1> call _putc - 475 00000374 81C404000000 <1> add esp, 4 - 476 0000037A E900000000 <1> jmp scdone - 477 <1> sc2: - 478 <1> - 479 <1> scdone: - 480 0000037F 07 <1> pop es - 481 00000380 1F <1> pop ds - 482 00000381 61 <1> popa - 483 00000382 CF <1> iret - 484 <1> - 485 <1> - 486 <1> - 487 <1> - 488 <1> - 489 <1> - 490 <1> - 491 - 492