Which file does is first read by the cpu in the booting proccess

http://lxr.linux.no

OK in this link which file is first read, I think it should be in assembly language where the computer is introduced to the c language.
7 answers Last reply
More about which file read booting proccess
  1. The entry point for the kernel is the label "_start" in "header.S" (for the x86 version). That's in the arch/x86/boot directory.
  2. Just to be clear, C language is compiled into assembly language so it can be run.
  3. That's true, but the OP is correct to assume that the initial kernel routines are written directly in assembler, not C.
  4. Ijack said:
    That's true, but the OP is correct to assume that the initial kernel routines are written directly in assembler, not C.

    Very true, and that is also true for any operating system I am aware of, at least on x86 type hardware, where you must perform tricky stuff like switching from real/16-bit mode into protected/32-bit or 64-bit mode.
  5. Forgive me, my experience with Assembly was limited to an 8088 in classes on a Friday afternoon following lunches in the student bar. I'm somewhat amazed that they still need to start a 64bit CPU in real mode and switch twice to get into 64Bit mode. Would this issue still exist if you were running EFI and not BIOS?
  6. I honestly don't know the answer to that one. But before you can switch to 64-bit mode you need to set up segment selectors, an interrupt table and paging. Conceivably these could be set to some standard values, but normally you would want to specify these details yourself. But there are still several other things that you will want to set up that cannot be accessed from C (several configuration registers for example), so a certain amount of assembler is always going to be required.

    I guess if the x86-64 didn't care about backwards compatibility it would be a lot cleaner. I'd be interested in studying the IA64, but where can you easily get hold of one of them? The PPC and ARM processors are a bit cleaner in this respect.
  7. audiovoodoo said:
    Forgive me, my experience with Assembly was limited to an 8088 in classes on a Friday afternoon following lunches in the student bar. I'm somewhat amazed that they still need to start a 64bit CPU in real mode and switch twice to get into 64Bit mode. Would this issue still exist if you were running EFI and not BIOS?


    A *lot* of the legacy crap of BIOS was cut out in the move over to UEFI, but your old friend real-mode still is alive and kicking and, again, this is all due to the combination of desire to maintain compatibility with various flavors of CP/M and DOS and a nasty chicken-and-egg issue between Intel/AMD and the mobo manufacturers
Ask a new question

Read More

Computers CPUs