KernelNewbies
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Kernel Hacking

  • Frontpage

  • Kernel Hacking

  • Kernel Documentation

  • Kernel Glossary

  • FAQ

  • Found a bug?

  • Kernel Changelog

  • Upstream Merge Guide

Projects

  • KernelJanitors

  • KernelMentors

  • KernelProjects

Community

  • Why a community?

  • Regional Kernelnewbies

  • Personal Pages

  • Upcoming Events

References

  • Mailing Lists

  • Related Sites

  • Programming Links

Wiki

  • Recent Changes

  • Site Editors

  • Side Bar

  • Tips for Editors

  • Hosted by WikiWall

Navigation

  • RecentChanges
  • FindPage
  • HelpContents

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

KernelNewbies:
  • BootStrapFromPcBios

Linux 0.01 bootstrap from PC Bios.

Back to Kernel001WalkThrough.

This is in assembler source file boot/boot.s. Read Linus' BootComments if you like. In short, the boot device is assumed to be a floppy drive, and Linus has designed for a maximum kernel size of 512k (8*64k). PCs with only 1MB RAM were fairly common in the early 1990's.

The first thing it does when loaded by bios_start at 0x7c00 is to copy itself to 0x90000, then jump to the relocated code, where it uses BIOS calls to write the message "\nLoading system...\n\n", reads the system image directly at address 0x10000 from the boot device using BIOS calls, then turns off the floppy drive, saves the cursor position, turns off interrupts, and relocates the system image to address 0.

The addresses of a suitable Interrupt Descriptor Table (IDT) and Global Descriptor Table (GDT) are then loaded into the appropriate 386 registers. These tables are stored as data in the bootstrap code image.

The key-board buffer is emptied. The interrupts are reprogrammed (ouch! you can really feel Linus's pain, here!). Then the process is switched to protected mode. It then jumps to execute the relocated system image. The code involved here is described in ThirtyTwoBitInitialization.

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01