Writing a Simple Operating System — from Scratch
CHAPTER 4. ENTERING 32-BIT PROTECTED MODE 37 Like I said before, the actual switchover is fairly straight forward to code, but i ...
CHAPTER 4. ENTERING 32-BIT PROTECTED MODE 38 CPU to flush the pipeline (i.e. complete all of instructions currently in different ...
CHAPTER 4. ENTERING 32-BIT PROTECTED MODE 39 lgdt [gdt_descriptor] ; Load our global descriptor table , which defines ; the prot ...
CHAPTER 4. ENTERING 32-BIT PROTECTED MODE 40 ; This is where we arrive after switching to and initialising protected mode. BEGIN ...
Chapter 5 Writing, Building, and Loading Your Kernel So far, we have learnt a lot about how the computer really works, by commun ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 42 int my_function () { return 0xbaba; } Save the code in Figure XXXX into ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 43 $ld -o basic.bin -Ttext 0x0 --oformat binary basic.o Note that, like th ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 44 from left to right, show the file offsets of the instructions, the mach ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 45 00000000 55 push ebp 00000001 89E5 mov ebp ,esp 00000003 83EC10 sub esp ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 46 So the value0xbabais stored directly to the appropriate position of the ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 47 0000001A 5D pop ebp 0000001B C3 ret Firstly, notice how we can differnt ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 48 total = a + b;, some more space will be reserved for the variabletotal, ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 49 void my_function () { char* my_string = "Hello"; } As before, we can di ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 50 The involved steps are as follows: Write and compile the kernel code. ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 51 lack of BIOS will make it hard for us to use the disk: we would have to ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 52 BEGIN_PM: mov ebx , MSG_PROT_MODE ; Use our 32-bit print routine to cal ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 53 5.2.3 Finding Our Way into the Kernel It was definitely a good idea to ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 54 call main ; invoke main() in our C kernel jmp $ ; Hang forever when we ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 55 $make kernel.o which will re-compile our C source file only ifkernel.od ...
CHAPTER 5. WRITING, BUILDING, AND LOADING YOUR KERNEL 56 It is often useful to specify targets that are not actually real target ...
«
1
2
3
4
»
Free download pdf