diff options
| -rw-r--r-- | boot/mbr.asm | 37 | ||||
| -rw-r--r-- | kernel/pci.c | 2 |
2 files changed, 36 insertions, 3 deletions
diff --git a/boot/mbr.asm b/boot/mbr.asm index d4dcbe5..a9c26f7 100644 --- a/boot/mbr.asm +++ b/boot/mbr.asm @@ -26,8 +26,8 @@ KERNEL_OFFSET equ 0x1000 jmp boot_16 ;start boot process ;SOME Global Data, mainly strings -;STR_VERSION: -; db "v0.2~",0 +STR_VERSION: + db "v0.2~",0 ;STR_PROT: ; db "32-bit PM",0 ;STR_LOADED: @@ -57,8 +57,41 @@ BOOT_DRIVE: ;lets start [bits 16] + +;print_string routine ([bx]) +;this routine will print a null terminated string at [bx] to the screen. +print_string: + + pusha ;push all registers + mov ah,0x0e + + print_string_loop: + + ;check if value at [bx] is "\0" (end of string) + mov cl,[bx] + cmp cl,0 + je print_string_finish + + ;otherwise instruct BIOS to print the current char + mov al,cl + int 0x10 + + ;proceed with next char + inc bx + jmp print_string_loop + + print_string_finish: + + popa ;pop all registers + ret ;return to caller + + + boot_16: + mov bx, STR_VERSION + call print_string + ;setup the stack mov bp,0x8000 mov sp,bp diff --git a/kernel/pci.c b/kernel/pci.c index 6cf71f8..5e1c869 100644 --- a/kernel/pci.c +++ b/kernel/pci.c @@ -131,7 +131,7 @@ uint16_t pciCheck(uint8_t bus, uint8_t slot) // uint16_t irq2=pciConfigReadWord(bus,slot,0,0x3E); test_bar(bus,slot,0x10); - // test_bar(bus,slot,0x14); + test_bar(bus,slot,0x14); test_bar(bus,slot,0x18); // scr_put_hex(irq); |
