From ae8250db6be517d521f8bf80373f446521ba842a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Wed, 14 Dec 2016 08:03:52 +0100 Subject: [PATCH] Fix some badly formated bullet point lists --- pages/2012-07-30-Privilege-Levels.md | 4 ++++ pages/2012-08-08-Thread-Stacks.md | 4 ++++ pages/2013-01-20-Z80-Information.md | 1 + pages/2013-01-21-Z80-Tester.md | 1 + 4 files changed, 10 insertions(+) diff --git a/pages/2012-07-30-Privilege-Levels.md b/pages/2012-07-30-Privilege-Levels.md index 219b453..f15e28f 100644 --- a/pages/2012-07-30-Privilege-Levels.md +++ b/pages/2012-07-30-Privilege-Levels.md @@ -71,6 +71,7 @@ despite the problems they cause with segmentation and TSS and stuff. ###Changing the privilege level Changing the CPL is actually two different problems. + - Increasing CPL - Decreasing CPL @@ -89,15 +90,18 @@ or through the `IRET` instruction Let's change the topic for a minute and think about interrupts. Say the processor is running in __Kernel Mode__ (Ring 0, CPL=0) and an interrupt happens. What the processor does then is: + - Push SS and ESP to stack - Push EFLAGS to stack - Push CS and EIP to stack - Load CS and EIP from the IDT + and from there the interrupt handling routine takes over. The interrupt handling routine does its thing and then runs the `IRET` instruction. `IRET` makes the processor do the same thing as when an interrupt happens, but _backwards_. I.e: + - Pop CS and EIP from stack - Pop EFLAGS from stack - Pop SS and ESP from stack diff --git a/pages/2012-08-08-Thread-Stacks.md b/pages/2012-08-08-Thread-Stacks.md index 1e55f43..979a31b 100644 --- a/pages/2012-08-08-Thread-Stacks.md +++ b/pages/2012-08-08-Thread-Stacks.md @@ -11,11 +11,14 @@ arguments and return addresses. In other words, the stack comes in use every time there is a function call. The common way a function call is handled by a c compiler is this: + - Push each argument to the stack (in reverse order) - Execute the `CALL` instruction (which pushes the address of the next + instruction to the stack and jumps to the callee) The callee does the following: + - Push the base pointer to the stack - Sets the base pointer to the current stack pointer - Subtracts the stack pointer to reserve place for local variables. @@ -23,6 +26,7 @@ The callee does the following: - Increase the stack pointer to free the space used by local variables. - Pop the base pointer from stack. - Execute the `RET` instruction (which puts the return value in EAX and + jumps to the position at the top of the stack. While the callee is doing its thing it now has access to all the pushed diff --git a/pages/2013-01-20-Z80-Information.md b/pages/2013-01-20-Z80-Information.md index e30ba4c..af562eb 100644 --- a/pages/2013-01-20-Z80-Information.md +++ b/pages/2013-01-20-Z80-Information.md @@ -36,6 +36,7 @@ appreciate some of those features. What I appreciate even more - at least this far - is the following hardware features of the Z80 compared to the 8080. + - A single 5V power supply - as opposed to +5V, -5V and +12V for the 8080 - A single clock signal input - as opposed to two for the 8080 diff --git a/pages/2013-01-21-Z80-Tester.md b/pages/2013-01-21-Z80-Tester.md index 2579432..6a8c471 100644 --- a/pages/2013-01-21-Z80-Tester.md +++ b/pages/2013-01-21-Z80-Tester.md @@ -150,6 +150,7 @@ Let's take a closer look at the signals used. ![Z80 tester running 3](/media/img/z80_running3.png) Here I also connected to the oscilloscope + - `/M1` - `/MREQ` - `/RD`