From 2e0fa08605098187eb4ac6fbf8fdbdd9c54faa62 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Mon, 10 Aug 2015 13:07:52 +0200 Subject: [PATCH] Uncapitalize `BITS` for consistency (and move it after `section`) --- _posts/2015-07-22-rust-os-boot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/2015-07-22-rust-os-boot.md b/_posts/2015-07-22-rust-os-boot.md index 4f842755..4371469f 100644 --- a/_posts/2015-07-22-rust-os-boot.md +++ b/_posts/2015-07-22-rust-os-boot.md @@ -82,8 +82,8 @@ To boot our kernel, we must add some code that the bootloader can call. Let's cr ```nasm global start -BITS 32 section .text +bits 32 start: mov dword [0xb8000], 0x2f4b2f4f hlt @@ -91,8 +91,8 @@ start: There are some new commands: - `global` exports a label (makes it public). As `start` will be the entry point of our kernel, it needs to be public. -- `BITS 32` specifies that the following lines are 32-bit instructions. It's needed because the CPU is still in [Protected mode] when GRUB starts our kernel. When we switch to [Long mode] in the [next post] we can use `BITS 64` (64-bit instructions). - the `.text` section is the default section for executable code +- `bits 32` specifies that the following lines are 32-bit instructions. It's needed because the CPU is still in [Protected mode] when GRUB starts our kernel. When we switch to [Long mode] in the [next post] we can use `bits 64` (64-bit instructions). - the `mov dword` instruction moves the 32bit constant `0x2f4f2f4b` to the memory at address `b8000` (it writes `OK` to the screen, an explanation follows in the [next post]) - `hlt` is the halt instruction and causes the CPU to stop