[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GRUB Hacking Guidance, Adding Xmodem
From: |
Craig |
Subject: |
GRUB Hacking Guidance, Adding Xmodem |
Date: |
Sat, 19 Feb 2005 21:03:27 -0800 (PST) |
Id like to add Xmodem capability to GRUB Legacy
0.95/0.96. Instead of obtaining a kernel from a tftp
server a la ifconfig, Id like to have GRUB accept a
kernel via xmodem. Ill be doing this over a
null-modem link, but conceivably this could be over a
modem as well.
Id like affect as little of the existing GRUB code as
possible. Lets say Ive got a function
int xmodem_receive(char* file, int maxbytes);
file is a pointer of maxbytes where the contents of
the received kernel or initrd will be written. The
return value indicates the actual size* of the
received file.
While Ive used and configured GRUB many times, Ive
never touched the GRUB source code before. About all
I know is that Ill need to build this into stage2.
Also, after noticing the memory map in the document
(Hacking GRUB section) I realize malloc is probably
out of the question. Here are my thoughts/questions
so far:
1. Ill need a token similar to (nd) to indicate that
a file is to be received via the console, say
(xmodem).
2. Ill need to add to (or identify an existing spot)
in the memory map. Where does (nd) put the
kernel/initrd?
3. What functions in GRUB will I need to modify?
Where should xmodem_receive be called? It will need
to be called once to obtain a kernel, and a second
time to obtain an initrd.
Thanks!
Craig
And for the curious, heres some additional background
as to why Im interested in this:
- With a brand new head-less, keyboard-less system,
Id like to be able to pop a GRUB boot CD in the
drive, redirect the console to the serial port, and
upload a linux kernel+initrd image over the serial
line. Out of the box, GRUB supports all but the
serial upload of a kernel and initrd image.
- No need to compile GRUB with netboot support.
Especially useful when neither GRUB nor EtherBoot
supports a given NIC (and the NIC doesnt support
PXE).
To keep things simple Im initially planning on coding
up the xmodem receive myself. Im aware of the
shortcomings of xmodem--if this type of functionality
is useful in the GRUB baseline I would consider
leveraging off of the lrzsz code to support
X/Y/ZModem (lrzsz is a GPLed branch of rzsz).
* I believe the receive end of Xmodem rounds file
sizes up to within a few bytes--assume this isnt an
issue for this discussion.
__________________________________
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.
http://info.mail.yahoo.com/mail_250
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- GRUB Hacking Guidance, Adding Xmodem,
Craig <=