From: adrian15 <adrian15@raulete.net>
To: grub-devel@gnu.org
Subject: int13 and non-reboot drives mapping
Date: Wed, 24 Jan 2007 18:22:10 +0100 [thread overview]
Message-ID: <45B795C2.3030804@raulete.net> (raw)
This is about the drive shift that I wrote the other day about grub2
sci-fi and all.
I've finally decided that this usbshift command should be run as a
normal command not anything inside a preset menu.
I've seen that we have to boot into the usb drive again to make
effective changes of mapping drives. It is very annoying! And, of
course, I do not want to boot into the pendrive once booted into it.
I've studied grub legacy's root command source code (check at the email
bottom) and I ask myself if I could write a command that only will do
this part of the code I suppose that without the gateA20(0) (I've read
something related to high memory but I think it is not useful for
mapping.) but as I am not very sure I need your advice if you do not mind.
My idea is that the usbshift command should first shift the drives
thanks to map command and then run the mentioned piece of code.
My AdamLGrub's variable: grub_device (that represents grub device)
should be set to (hd4,0) if it was to set to (hd0,0) and there are 5
hard disks (including the usb drive).
And then the next command to run is a configfile to somewhere like:
configfile $(grub_device)/boot/sgd/menu.lst
this will update the grub legacy's variables concerning to where grub is
working like: saved_drive and saved_partition...
As long as menu.lst files are run from the RAM there should not be any
problem like there would be with a function trying to read from a hard disk.
If you do not like the configfile idea you could also set them
inside the usbshift command calling to root command so that it accepts
as an argument (NEWUSBHD,OLDPART) such as: (hd4,0).
I suppose that BIOS ints are better handled (more elegant) in grub2 and
it should be easier for you to do that.
Any idea, mistake, advice?
adrian15
/* Check if we should set the int13 handler. */
if (bios_drive_map[0] != 0)
{
int i;
/* Search for SAVED_DRIVE. */
for (i = 0; i < DRIVE_MAP_SIZE; i++)
{
if (! bios_drive_map[i])
break;
else if ((bios_drive_map[i] & 0xFF) == saved_drive)
{
/* Exchage SAVED_DRIVE with the mapped drive. */
saved_drive = (bios_drive_map[i] >> 8) & 0xFF;
break;
}
}
/* Set the handler. This is somewhat dangerous. */
set_int13_handler (bios_drive_map);
}
gateA20 (0);
boot_drive = saved_drive;
chain_stage1 (0, BOOTSEC_LOCATION, boot_part_addr);
break;
next reply other threads:[~2007-01-24 17:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-24 17:22 adrian15 [this message]
2007-01-26 11:45 ` int13 and non-reboot drives mapping Yoshinori K. Okuji
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45B795C2.3030804@raulete.net \
--to=adrian15@raulete.net \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.