[SeaBIOS] Help with 16bit and 32bitFlat

Daniel Castro evil.dani at gmail.com
Thu Oct 20 16:17:11 CEST 2011


On Thu, Oct 20, 2011 at 9:57 PM, Kevin O'Connor <kevin at koconnor.net> wrote:
> On Thu, Oct 20, 2011 at 11:44:50AM +0200, Gerd Hoffmann wrote:
>> >> The disk access code is called from 16bit mode, and thus it needs to
>> >> be compiled in 16bit mode.  The link errors you are seeing are there
>> >> to force a build error (instead of failing mysterously at run time).
>> >>
>> >> What does your driver do that requires 32bit mode?
>>
>> Access special pages for communication with the hypervisor (grant
>> tables, request ring).
>
> If Xen just wants to run its handler in 32bit mode (and doesn't care
> about vm86 mode), it should be possible to do something like:
>
> int process_xen_op(struct disk_op_s *op) {
>    extern void _cfunc32flat_process_xen32_op(struct disk_op_s *);
>    return call32(_cfunc32flat_process_xen32_op, op, DISK_RET_EPARAM);
> }
>
> int VISIBLE32FLAT
> process_xen32_op(struct disk_op_s *op) {
>    if (! CONFIG_XEN_DISK_HANDLER)
>        return 0;
>    ...
> }
>
> Be aware that stack space is still limited here though (~512 bytes).
>
I am really want to use the 16Bit for the proccess_op, then only place
I have no idea if it will work (not that I see why not) is doing a
hypercall when I have to signal the RING that there is a request in
flight.

> -Kevin
>



-- 
+-=====---------------------------+
| +---------------------------------+ | This space intentionally blank
for notetaking.
| |   | Daniel Castro,                |
| |   | Consultant/Programmer.|
| |   | U Andes                         |
+-------------------------------------+



More information about the SeaBIOS mailing list