[SeaBIOS] Little help with call32

Daniel Castro evil.dani at gmail.com
Mon Apr 23 08:51:10 CEST 2012


Hello All,

I have a small problem with call32, after I make the call and the
32bit code is executed the parameter I am sending is incorrect, so
evidently I am doing something incorrect.

Here is my 16bit code:
	dprintf(1,"Operation 16bit drive at %p\n",op->drive_g);
	extern void _cfunc32flat_xen_blk_op_read(struct disk_op_s *);
	return call32(_cfunc32flat_xen_blk_op_read,op,DISK_RET_EPARAM);

Here is the 32Bit code:
int VISIBLE32INIT
xen_blk_op_read(struct disk_op_s *op){
	dprintf(1,"Xen Disk buffer %x lba %x count %d command
%d\n",op->buf_fl,op->lba,op->count,op->command);
	dprintf(1,"Searching for drive, loc: %p\n",op->drive_g);
	struct xendrive_s * xendrive = container_of(op->drive_g, struct
xendrive_s, drive); //the global struct is extracted
	if(xendrive==NULL)
		return -1;
...
}

I know something is wrong because the output is like this:
Operation 16bit drive at 0x0000d630
DEBUG call32: func 0x0f7e90a7 eax 832 err 1
Xen Disk buffer f000ff53 lba f000ff53 count -268370093 command 65363
Searching for drive, loc: 0xf000ff53

As you can see op->drive_g are located in different addreses in 16 and
32 bit modes.

Can someone help me out to find where the mistake is. The code seems
to be valid so I guess I am passing the pointer wrongly.

Thanks,

Daniel


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



More information about the SeaBIOS mailing list