Re: Linux Assembly
From: Kasper Dupont (kasperd_at_daimi.au.dk)
Date: 12/07/03
- Next message: Alan McKenney: "How to get post-mortem when system freezes."
- Previous message: Pete Zaitcev: "Re: Rescue floppy for 2.6"
- In reply to: Bill Cunningham: "Linux Assembly"
- Next in thread: Pete Zaitcev: "Re: Linux Assembly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 07 Dec 2003 23:12:54 +0100
Bill Cunningham wrote:
>
> I know there are short assembly code in the MBR, small enough to bootstrap.
The conventional MBR just contained code to load the boot sector from
the active partition and transfer control.
> I've seen some assembley code in the kernel source designed to do this I
> believe.
I don't think so. The MBR is not part of the kernel. Kernels until
version 2.4 contains a boot record, that can be used to load the
kernel from a floppy, but that was removed from 2.6 kernel. But for
a long time the prefered way to load a kernel was with some other
loader.
The first sector of a loader like LILO or GRUB contains code to
load the next stage of the loader, which takes up multiple sectors.
That first sector can in both cases be located either in the MBR
or in the boot record of a partition, in which case you would use
a conventional MBR to transfer control. (Is it possible to boot
any of them from the boot record of a FAT partition?)
> Linus wrote alot of this code
I don't think Linus wrote any of the LILO or GRUB code.
> Can C be used to bootstrap a computer from BIOS?
Even the running kernel requires some assembly code, bootstrapping
is in some ways worse. Port I/O and interrupt handling are some
examples of what requires assembly code. While language support
for such stuff is possible, it is really not worth much. It would
still be architecture dependant, so you might as well do it with
inline assembly.
-- Kasper Dupont -- der bruger for meget tid paa usenet. For sending spam use mailto:aaarep@daimi.au.dk /* Would you like fries with that? */
- Next message: Alan McKenney: "How to get post-mortem when system freezes."
- Previous message: Pete Zaitcev: "Re: Rescue floppy for 2.6"
- In reply to: Bill Cunningham: "Linux Assembly"
- Next in thread: Pete Zaitcev: "Re: Linux Assembly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|