Brendan: that is exactlly what I planned to do... however your code seems to enter PMode the get into Real mode and I was thinking on doing the opposite...
My bootloader starts by probing BIOS for some info (PnP info, APM, VESA, RAM...) and then it fixes A20 and enters pmode to setup memory management and determine the best addr to place the kernel and a couple of datatables for paging and mem. handling. After that it checks which file to load as kernel (either for a boot-commandline or the osparam file or default filename), and it is here I wan't to call BIOS.
I have tried to make my own code... but all I get is exceptions or bochs errors, for instance:
Code:
cli
mov eax, cr0
and eax,7FFFFFFFh
mov cr0,eax ;needs to disable paging
pushfd
push dword code16sel
push dword real_mode_readsector
iretd
real_mode_readsector:
bits 16
jmp $
Here is the GDT
Quote:
gdtr
dw gdt_ent-gdt-1
dd gdt
gdt
gdt0
nullseg equ $-gdt0
dw 0,0,0,0
code32sel equ $-gdt0
dw 0xffff, 0h
db 0h, 9ah, 0cfh, 0h
data32sel equ $-gdt0
dw 0xffff, 0h
db 0h, 92h, 0cfh, 0h
code16sel equ $-gdt
dw 0xffff, 0h
db 0h, 9ah 0fh, 0
gdt_end
And all I get is a error on 18h:7c48h according to bochs even that my bootloader is loaded by the bootsector to addr 10000h...
Any pointers?