From f9c54129a396b5d3a2e4c96af4fb9a9a20b80c7e Mon Sep 17 00:00:00 2001 From: Sebastian Fricke Date: Wed, 13 May 2020 17:55:44 +0200 Subject: [PATCH 1/3] linux-interrupts-2: Deprecated Makefile assignment Replace a deprecated Makefile assignment with the current version. Change was introduced with the following commit: https://lkml.org/lkml/2019/10/24/377 Signed-off-by: Sebastian Fricke --- Interrupts/linux-interrupts-2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Interrupts/linux-interrupts-2.md b/Interrupts/linux-interrupts-2.md index e041061..3d69382 100644 --- a/Interrupts/linux-interrupts-2.md +++ b/Interrupts/linux-interrupts-2.md @@ -78,7 +78,7 @@ As you can remember the 32-bit entry point is in the [arch/x86/boot/compressed/h But the 32-bit mode entry point is the second file in our case. The first file is not even compiled for `x86_64`. Let's look at the [arch/x86/boot/compressed/Makefile](https://github.com/torvalds/linux/blob/16f73eb02d7e1765ccab3d2018e0bd98eb93d973/arch/x86/boot/compressed/Makefile): ``` -vmlinux-objs-y := $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ +vmlinux-objs-y := $(obj)/vmlinux.lds $(obj)/kernel_info.o $(obj)/head_$(BITS).o \ ... ... ``` From 55ebd12262088ffa2f64b54756ba79b57ad3cc88 Mon Sep 17 00:00:00 2001 From: Sebastian Fricke Date: Wed, 13 May 2020 18:01:36 +0200 Subject: [PATCH 2/3] linux-interrupts-2: Reduce word repetion Reduce the repetion of words and set missing punctuation. Signed-off-by: Sebastian Fricke --- Interrupts/linux-interrupts-2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Interrupts/linux-interrupts-2.md b/Interrupts/linux-interrupts-2.md index 3d69382..ab19570 100644 --- a/Interrupts/linux-interrupts-2.md +++ b/Interrupts/linux-interrupts-2.md @@ -83,7 +83,7 @@ vmlinux-objs-y := $(obj)/vmlinux.lds $(obj)/kernel_info.o $(obj)/head_$(BITS).o ... ``` -We can see here that `head_*` depends on the `$(BITS)` variable which depends on the architecture. You can find it in the [arch/x86/Makefile](https://github.com/torvalds/linux/blob/16f73eb02d7e1765ccab3d2018e0bd98eb93d973/arch/x86/Makefile): +We can see here that `head_*` depends on the `$(BITS)` variable, which is based on the architecture. The variable is defined within [arch/x86/Makefile](https://github.com/torvalds/linux/blob/16f73eb02d7e1765ccab3d2018e0bd98eb93d973/arch/x86/Makefile): ``` ifeq ($(CONFIG_X86_32),y) From 4058f2418ac73cdfe77cbbde0d231539b84b7e9e Mon Sep 17 00:00:00 2001 From: Sebastian Fricke Date: Wed, 13 May 2020 18:52:59 +0200 Subject: [PATCH 3/3] linux-interrupts-2: Improve text block Remove redundant 'the' s/Now as we jumped on the startup_32 from the/Now as we jumped into `startup_32` from/ Remove redundant 'the', ensure a varied choice of words s/we will not find anything related to the interrupt handling here/ we will not encounter anything related to interrupt handling here/ Improve sentence structure s/The startup_32 contains code that makes preparations before the transition into long mode and directly jumps in to it/ The code inside of `startup_32` makes necessary preparations, before transitioning into the long mode with a direct jump/ Improve sentence structure and ensure a varied choice of words. s/it makes preparations before the kernel decompression that occurs in the decompress_kernel from the/ it makes arrangements for the kernel decompression that occurs in the `decompress_kernel` function inside of ../ Remove redundant 'the', vary the choice of words s/we jump on the startup_64 from the/we jump into `startup_64` defined at/ Reduce repetition, improve sentence structure s/we start to build identity-mapped pages. After we have built identity-mapped pages, checked the NX bit, setup the Extended Feature Enable Register (see in links), and updated the early Global Descriptor Table with the lgdt instruction, we need to setup gs register/ Signed-off-by: Sebastian Fricke --- Interrupts/linux-interrupts-2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Interrupts/linux-interrupts-2.md b/Interrupts/linux-interrupts-2.md index ab19570..a779c0c 100644 --- a/Interrupts/linux-interrupts-2.md +++ b/Interrupts/linux-interrupts-2.md @@ -95,7 +95,7 @@ else endif ``` -Now as we jumped on the `startup_32` from the [arch/x86/boot/compressed/head_64.S](https://github.com/torvalds/linux/blob/16f73eb02d7e1765ccab3d2018e0bd98eb93d973/arch/x86/boot/compressed/head_64.S) we will not find anything related to the interrupt handling here. The `startup_32` contains code that makes preparations before the transition into [long mode](http://en.wikipedia.org/wiki/Long_mode) and directly jumps in to it. The `long mode` entry is located in `startup_64` and it makes preparations before the [kernel decompression](https://0xax.gitbooks.io/linux-insides/content/Booting/linux-bootstrap-5.html) that occurs in the `decompress_kernel` from the [arch/x86/boot/compressed/misc.c](https://github.com/torvalds/linux/blob/16f73eb02d7e1765ccab3d2018e0bd98eb93d973/arch/x86/boot/compressed/misc.c). After the kernel is decompressed, we jump on the `startup_64` from the [arch/x86/kernel/head_64.S](https://github.com/torvalds/linux/blob/16f73eb02d7e1765ccab3d2018e0bd98eb93d973/arch/x86/kernel/head_64.S). In the `startup_64` we start to build identity-mapped pages. After we have built identity-mapped pages, checked the [NX](http://en.wikipedia.org/wiki/NX_bit) bit, setup the `Extended Feature Enable Register` (see in links), and updated the early `Global Descriptor Table` with the `lgdt` instruction, we need to setup `gs` register with the following code: +Now as we jumped into `startup_32` from [arch/x86/boot/compressed/head_64.S](https://github.com/torvalds/linux/blob/16f73eb02d7e1765ccab3d2018e0bd98eb93d973/arch/x86/boot/compressed/head_64.S), we will not encounter anything related to interrupt handling here. The code inside of `startup_32` makes necessary preparations, before transitioning into the [long mode](http://en.wikipedia.org/wiki/Long_mode) with a direct jump. The `long mode` entry is located in `startup_64` and it makes arrangements for the [kernel decompression](https://0xax.gitbooks.io/linux-insides/content/Booting/linux-bootstrap-5.html) that occurs in the `decompress_kernel` function inside of [arch/x86/boot/compressed/misc.c](https://github.com/torvalds/linux/blob/16f73eb02d7e1765ccab3d2018e0bd98eb93d973/arch/x86/boot/compressed/misc.c). After the kernel is decompressed, we jump into `startup_64` defined at [arch/x86/kernel/head_64.S](https://github.com/torvalds/linux/blob/16f73eb02d7e1765ccab3d2018e0bd98eb93d973/arch/x86/kernel/head_64.S). In `startup_64` we start to build identity-mapped pages, check the [NX](http://en.wikipedia.org/wiki/NX_bit) bit, setup the `Extended Feature Enable Register` (see in links) and update the early `Global Descriptor Table` with the `lgdt` instruction. And proceed to setup `gs` register with the following code: ```assembly movl $MSR_GS_BASE,%ecx