1
0
mirror of https://github.com/0xAX/linux-insides.git synced 2025-06-07 05:08:45 +00:00

Normalize indentation in linux-bootstrap-1's code sections to improve readability

This commit is contained in:
Matthieu Tardy 2016-01-22 03:11:21 +01:00
parent 7f8146db1e
commit c0c69b8dc0

View File

@ -313,8 +313,8 @@ Here we can see a `jmp` instruction opcode - `0xeb` to the `start_of_setup-1f` p
Actually this is the first code that runs (aside from the previous jump instruction of course). After the kernel setup got the control from the bootloader, the first `jmp` instruction is located at `0x200` (first 512 bytes) offset from the start of the kernel real mode. This we can read in the Linux kernel boot protocol and also see in the grub2 source code: Actually this is the first code that runs (aside from the previous jump instruction of course). After the kernel setup got the control from the bootloader, the first `jmp` instruction is located at `0x200` (first 512 bytes) offset from the start of the kernel real mode. This we can read in the Linux kernel boot protocol and also see in the grub2 source code:
```C ```C
state.gs = state.fs = state.es = state.ds = state.ss = segment; state.gs = state.fs = state.es = state.ds = state.ss = segment;
state.cs = segment + 0x20; state.cs = segment + 0x20;
``` ```
It means that segment registers will have the following values after kernel setup starts: It means that segment registers will have the following values after kernel setup starts:
@ -435,8 +435,8 @@ BSS Setup
The last two steps that need to happen before we can jump to the main C code, are setting up the [BSS](https://en.wikipedia.org/wiki/.bss) area and checking the "magic" signature. First, signature checking: The last two steps that need to happen before we can jump to the main C code, are setting up the [BSS](https://en.wikipedia.org/wiki/.bss) area and checking the "magic" signature. First, signature checking:
```assembly ```assembly
cmpl $0x5a5aaa55, setup_sig cmpl $0x5a5aaa55, setup_sig
jne setup_bad jne setup_bad
``` ```
This simply compares the [setup_sig](https://github.com/torvalds/linux/blob/master/arch/x86/boot/setup.ld#L39) with the magic number `0x5a5aaa55`. If they are not equal, a fatal error is reported. This simply compares the [setup_sig](https://github.com/torvalds/linux/blob/master/arch/x86/boot/setup.ld#L39) with the magic number `0x5a5aaa55`. If they are not equal, a fatal error is reported.