[SeaBIOS] Help with struct disk_op_s and block drives

Daniel Castro evil.dani at gmail.com
Tue Oct 18 09:05:47 CEST 2011


On Fri, Oct 14, 2011 at 8:22 AM, Kevin O'Connor <kevin at koconnor.net> wrote:
> On Thu, Oct 13, 2011 at 09:17:51PM +0900, Daniel Castro wrote:
>> Hello,
>> I am working on the PV block drivers for Xen.
>>
>> I am in the point where I must write to my PV ring the requests and responses.
>> I need a little help to understand how this works :)
>> The operation comes wrapped in this structure:
>> struct disk_op_s {
>>     u64 lba;
>>     void *buf_fl;
>>     struct drive_s *drive_g;
>>     u16 count;
>> lba is the sector I need to read or write to, right?
>
> Yes.
>
>> count is how many sectors I am going to move, right?
>
> Yes.
>
>> buf_fl is the pointer to the buffer where I will put the info in case
>> of write, or I will get the info in case of read, right?
>
> Yes.
>
>> command is either read or write.
>
> Command can be other things as well - see some of the other drivers.
>
>> drive_s contains the descriptor of the drive.
>
> Yes.
>
>> How does seabios handle more than one drive? My case, right now is
>> only one drive but there will be more.
>
> During the initialization phase, your driver should create a drive_s
> structure for each available drive and pass it to boot_add_hd().  On
> an access request, the disk_op_s struct will point to the drive_s
> struct of the requested drive.

Thanks for the reply Kevin, also can you point me to some of seabios
documentation, I am in the process of making a presentation for
XenSumit on this work, and would like to go on some detail about the
inner working of Seabios. Maybe how it interacts with qemu? anyway any
documentation would be greatly appreciated.

Thanks again for your help.

Daniel
>
> -Kevin
>



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



More information about the SeaBIOS mailing list