[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PUPA disk questions
From: |
Yoshinori K. Okuji |
Subject: |
Re: PUPA disk questions |
Date: |
Sat, 25 Oct 2003 16:52:49 +0200 |
User-agent: |
KMail/1.5 |
On Saturday 25 October 2003 16:03, Marco Gerards wrote:
> > I think it is okay. If you don't like invalidating caches all the time,
> > you could define a minimum life time of caches (e.g. one second), as
> > nobody can exchange a media so quickly.
>
> I agree. This requires a timer and possibly interrupts, is that a
> problem?
It can be much simpler. You just need to know current time. I assume that all
architectures GRUB should support have RTC. Then, this code is not perfect
but should be enough:
void
invalidate_cache_if_required (void)
{
static pupa_time_t last_time = 0;
pupa_time_t current_time = get_rtc ();
if (last_time + MINIMUM_LIFE_TIME > current_time)
return;
invalidate_cache ();
last_time = current_time;
}
> Perhaps this just sucks, I didn't have my C book nearby. I think it
> isn't quite portable, but a lot easier to use. I will have a look if
> it is C99 or something like that.
Your code is good, except that a tag is missing. It can be compiled by any C
compiler just fine.
> I didn't have any idea yet, I'd appreciate your opinion here. I was
> just wondering if what you had in mind was an interactive setup.
Well, what I'm thinking about "setup" is that it does not have all the
features that you can do with the command "install". I don't remember all,
but the biggest problem is that you cannot specify the often-misleading
option "d" in "install". It embeds the number of a boot drive into an
installed GRUB image, and this is required when your BIOS or chainloader does
not pass the number of a boot drive to GRUB correctly.
But I even don't know if that mysterious option should exist or not. Ideally,
it is better not to embed a boot drive into GRUB itself, because the user can
move a hard disk where GRUB was installed to anywhere, and GRUB is still
bootable. But some BIOSes seem to be too buggy, so the user sometimes must
specify the option "d". This is very bad.
I have already added a workaround for a buggy BIOS into the CVS version of
GRUB (but not to PUPA), but I don't know if it works even with other buggy
BIOSes. It is necessary to test the code widely, and judge if GRUB always
embeds or never embed.
> BTW, ext2fs works on the PPC. I had to make a few small changes. (I
> forgot a few pupa_le_to_cpuxx calls.
That is very good.
BTW, I have added you into projects members on Savannah, so that you can use
the CVS repository arbitarily. Feel free to check in your changes into the
repository.
Okuji
Re: PUPA disk questions, Marco Gerards, 2003/10/27