Page 1 of 1

Calling Bios32-Service -> General Protection Fault

Posted: Tue Mar 27, 2007 2:43 am
by sevobal
Hi guys,
I've written a routine to detect the BIOS32 Service directory and his entry point (I've checked it also with a hex-editor). But if I try to call it, I get a "General Protection Fault". So what I'm doing wrong?

Here are some more infos for you
- CS and DS have the same base
- CS is execute-only
- DS is read / write (because if I set it to read only my System will not boot)
- I think the calling environment has access to IO space

Maybe it's because I didn't enabled paging, but is it neccessary?

Thank you for your help!

Posted: Tue Mar 27, 2007 3:35 am
by Combuster
have you used an debugger to find the failing instruction / line of code?
Bochs is your friend here :wink:

Posted: Tue Mar 27, 2007 4:24 am
by sevobal
I've a little understanding question.
My OS GDT has just 3 Entries, NULL descriptor, cs descriptor and ds descriptor.
Now if I want to use BIOS32 should I add three more entries (cs, ds, ss)?
And when should they be loaded and how does the BIOS32 know in which descriptor he should use (system: null, cs, ds or the new cs, ds, ss)?
If I understand the documentation of BIOS32 I should build three new descriptors, shouldn't I?

Posted: Wed Mar 28, 2007 9:15 pm
by Kevin McGuire
I know you can call the first entry point using CS, DS, and SS set to the entire address space. I think you just have to make sure all three have the same base address that encompasses the BIOS 32 Service Directory block.

You will also have to perform a far call into it IIRC. I did it but abandoned the idea when I realized I could directly access the PCI bus using ports instead.

Bochs and Qemu do not support the $PCI service from the BIOS 32 Service Directory.