Skip to Content
Understanding the Linux Kernel, Second Edition
book

Understanding the Linux Kernel, Second Edition

by Daniel P. Bovet, Marco Cesati
December 2002
Intermediate to advanced
784 pages
27h 7m
English
O'Reilly Media, Inc.
Content preview from Understanding the Linux Kernel, Second Edition

Middle Ages: The setup( ) Function

The code of the setup( ) assembly language function is placed by the linker immediately after the integrated boot loader of the kernel—that is, at offset 0x200 of the kernel image file. The boot loader can therefore easily locate the code and copy it into RAM, starting from physical address 0x00090200.

The setup( ) function must initialize the hardware devices in the computer and set up the environment for the execution of the kernel program. Although the BIOS already initialized most hardware devices, Linux does not rely on it, but reinitializes the devices in its own manner to enhance portability and robustness. setup( ) performs the following operations:

  1. Invokes a BIOS procedure to find out the amount of RAM available in the system.

  2. Sets the keyboard repeat delay and rate. (When the user keeps a key pressed past a certain amount of time, the keyboard device sends the corresponding keycode over and over to the CPU.)

  3. Initializes the video adapter card.

  4. Reinitializes the disk controller and determines the hard disk parameters.

  5. Checks for an IBM Micro Channel bus (MCA).

  6. Checks for a PS/2 pointing device (bus mouse).

  7. Checks for Advanced Power Management (APM) BIOS support.

  8. If the kernel image was loaded low in RAM (at physical address 0x00010000), moves it to physical address 0x00001000. Conversely, if the kernel image was loaded high in RAM, the function does not move it. This step is necessary because to be able to store the kernel image on a floppy ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Understanding the Linux Kernel, 3rd Edition

Understanding the Linux Kernel, 3rd Edition

Daniel P. Bovet, Marco Cesati
Understanding the Linux Kernel

Understanding the Linux Kernel

Daniel P. Bovet, Marco Cesati
Linux Kernel Programming

Linux Kernel Programming

Kaiwan N. Billimoria

Publisher Resources

ISBN: 0596002130Catalog PageErrata