bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Operating system independence; Hurd Port.


From: Andrew Clausen
Subject: Re: [PATCH] Operating system independence; Hurd Port.
Date: Fri, 30 Mar 2001 11:54:46 +1000

Neal H Walfield wrote:
> > OK.  This in parted 1.5.x or 1.4.x?  Anyway, I can't reproduce it.
> 
> 1.5.x.
> 
> I am curious what they plans are for intergrating the code and what, if
> any thing, you would like me to do.

Sorry, I should have written to you earlier... although I think this stuff
is easier by IRC.

Anyway, I think the abstractions are bad.  Basically, you separated the
code by what was convienient to do.

I think we should do something similar to the way disk.c and disk_*.c work.
The main difference is we don't need to support multiple platforms
simultaneously, in the one binary.  This is basically an abstract class.

So, I propose that we have 3 files: device.c, device_linux.c, device_gnu.c
(BTW, why not device_hurd.c?)

Second, we have an API between device.c and device_*.c.  This will hopefully
be pretty much one way, but the general convention is: private functions
in device.c that we want device_*.c to see we call _ped_device_*(), and
_arch_device_*() in device_*.c

ped_device_stat(), ped_device_probe_all() and _do[_refresh]_{open,close} should
be moved into os-dependent code.

So, the arch interface is something like:
_arch_device_{new,stat,[refresh]_{open,close},read,write,check,sync}
_arch_probe_all

the private _ped_device() interface would be:
_ped_device_alloc()
_ped_device_free()
_ped_device_register()
_ped_device_unregister()

The PedDevice interface in <parted/device.h> would be unchanged.

Sane?

Andrew Clausen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]