Yet Another Fat12 Problem YaFP 12 :-)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
ich_will

Re:Yet Another Fat12 Problem YaFP 12 :-)

Post by ich_will »

This is my first stage bootloader, it loads the second_stage loader to the address: 0x500 and the jumps to it. It must have the name boot2.bin. Can Somebody test this bootloader? I think there is a mistake but I don't know which and where.

[attachment deleted by admin]
ich_will

Re:Yet Another Fat12 Problem YaFP 12 :-)

Post by ich_will »

But It can also be that the mistake is in the second stage bootloader. I think it is. If i jump to the loaded kernel the CPU crashes. The load_second and the load_kernel functions are almost the same, with one exception, the addresses where the sector buffer and the kernel is load.

I think this file is ok because it works in my old bootloader:

Code: Select all

;----------------------- gdt.inc -----------------------
gdt:
NULL_SEL equ $-gdt
; null descriptor
   dw 0         ; limit 15:0
   dw 0         ; base 15:0
   db 0         ; base 23:16
   db 0         ; type
   db 0         ; limit 19:16, flags
   db 0         ; base 31:24

; data descriptor
DATA_SEL equ $-gdt
   dw 0xFFFF      ; limit 15:0
   dw 0x00         ; base  15:0
   db 0x00         ; base  23:16
   db 0x92         ; access byte: present, ring0, code/data segment, non-executable, non-conforming, writeable, not-accessed
   db 0xC0         ; flags: Granularity, 32-bit
   db 0x00         ; base 31:24

; stack descriptor
STACK_SEL equ $-gdt
   dw 0xFFFF      ; limit 15:0
   dw 0x00         ; base  15:0
   db 0x00         ; base  23:16
   db 0x92         ; access byte: present, ring0, code/data segment, non-executable, non-conforming, writeable, not-accessed
   db 0xC0         ; flags: Granularity, 32-bit
   db 0x00         ; base 31:24

; code descriptor
CODE_SEL equ $-gdt
   dw 0xFFFF      ; limit 15:0
   dw 0x00         ; base  15:0
   db 0x00         ; base  23:16
   db 0x9A         ; access byte: present, ring0, code/data segment, executable, non-conforming, readable, not-accessed
   db 0xC0         ; flags: Granularity, 32-bit
   db 0x00         ; base 31:24

gdt_end:

gdt_desc:
   dw gdt_end - gdt - 1   ; GDT limit
   dd gdt         ; linear address of GDT
[attachment deleted by admin]
Post Reply