C kernel runs now after fixing bootloader and build, beginnings of a REPL

This commit is contained in:
2015-01-25 17:46:12 -08:00
parent 5e4513dd22
commit f6e2d0c19b
4 changed files with 267 additions and 30 deletions

View File

@@ -2,6 +2,10 @@
[org 0x7C00] ; Origin at 0x7C00 (upper end of memory)
start:
;; FIXME - we need to relocate ourselves to the
;; upper end of memory somewhere so we can overwrite
;; ourselves with the kernel at 0x0000
call blankScreen
mov dx, 0x0
@@ -13,10 +17,10 @@ start:
mov dl, 0x0
call setCursorPosition
mov al, 0x1 ; read the remaining 16 tracks
mov al, 0x10 ; read the remaining 16 tracks
mov ch, 0x0 ; .... on track 0 ....
mov cl, 0x2 ; .... starting at sector 2
mov bx, 0x1000 ; 0x1000 is a standard kernel start location
mov bx, 0x1000 ; Load the kernel into the bottom of memory
mov es, bx
mov bx, 0x0 ; bx = 0, es:bx = 0x1000:0
call loadFloppyDiskSectors
@@ -58,6 +62,11 @@ _end_floppy_read:
call setCursorPosition
mov si, _str_floppydone
call printString
mov ax, 0x1000
mov ds, ax
mov ax, 0x1000
mov ss, ax
mov sp, 0xFFFF
jmp _extern_c_main
%include "libinterrupt.S"
@@ -69,4 +78,3 @@ _end_floppy_read:
times 510 - ($ - $$) db 0 ; fill up to 510 bytes with 0
dw 0xAA55 ; magic bootloader signature

View File

@@ -1,4 +1,26 @@
_extern_c_backupCursor:
jmp 0x1000:0x001e
_extern_c_blankScreen:
jmp 0x1000:0x03b6
_extern_c_strlen:
jmp 0x1000:0x00ba
_extern_c_main:
jmp 0x1000:0x0049
_extern_c_printCh:
jmp 0x1000:0x0412
_extern_c_getkey:
jmp 0x1000:0x0155
_extern_c_repl:
jmp 0x1000:0x02ea
_extern_c_strcmp:
jmp 0x1000:0x0265
_extern_c_advanceCursor:
jmp 0x1000:0x0067
_extern_c_setCursorPosition:
jmp 0x1000:0x0000
_extern_c_memset:
jmp 0x1000:0x0227
_extern_c_putc:
jmp 0x1000:0x00a0
_extern_c_puts:
jmp 0x1000:0x00f4
_extern_c_gets:
jmp 0x1000:0x017b