From 7fb90a7f8738449d8ce0772f0783955642a8a933 Mon Sep 17 00:00:00 2001 From: Daniel Kibblewhite <daniel2.kibblewhite@live.uwe.ac.uk> Date: Wed, 4 Dec 2024 10:43:16 +0000 Subject: [PATCH] ws2 readme added - coder is broken --- Worksheet2/README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/Worksheet2/README.md b/Worksheet2/README.md index e69de29..0caf296 100644 --- a/Worksheet2/README.md +++ b/Worksheet2/README.md @@ -0,0 +1,51 @@ +# Worksheet 2 + +This is my README for Worksheet 2. As you will see from the file and the amount of content within it, I have really struggled during this worksheet and have done what I can (which I'll admit isn't much). Coding is extremely hard for someone who has not done much of it before. + +I scraped through last year by the skin of my teeth as I had help from Nathan and other staff. However, this year, trying to juggle work life, uni life, and family situations, I have not been able to do the same. + +In order to get to the end of the first task, I have followed the Tiny OS book. + +## Important points from the code: + +```assembly +MAGIC_NUMBER equ 0x1BADB002 ; Multiboot magic number +``` +The `MAGIC_NUMBER` is a constant that represents the Multiboot magic number. This number is important because it serves as a signature that the bootloader checks to determine whether it is loading a Multiboot-compliant kernel. If the magic number is correct, it ensures that the kernel is being loaded in a compatible environment. + +```assembly +loader: ; Entry point + mov eax, 0xCAFEBABE ; Move 0xCAFEBABE into EAX +``` +In this snippet, the code is moving the hexadecimal value `0xCAFEBABE` into the `EAX` register. This value is often used as a marker or identifier, and its presence may be crucial for subsequent operations in the boot process, indicating that the loader has successfully executed. + +### Running the OS + +```bash +qemu-system-i386 -nographic -boot d -cdrom os.iso -m 32 -d cpu -D logQ.txt +``` + +With the kernel (os.iso) all set and ready, it's time to unleash it into the wild. This time, we’re not sticking to the conventional methods found in textbooks; instead, we’re diving into the world of QEMU. As a powerful open-source machine emulator and virtualiser, QEMU opens the door to endless possibilities. + +Using this versatile emulator, we can fire up our machine without breaking a sweat or interrupting our workflow. It's like having a virtual playground where we can experiment freely. Plus, it lets us track the machine's execution in real-time, ensuring we can verify that EAX gets its moment in the spotlight. Get ready to make some magic happen! + +#### SIDENOTE + +It's a little heartbreaking that I couldn't compile all the steps for this worksheet just yet—consider it a bug in my coding journey. I'll definitely be tackling those remaining tasks later, and I’ll recruit some help to peer-review them because I thrive on challenges! However, I recognise that I need to debug my understanding of coding before diving back in. So, feel free to revisit this repo down the line to see if I’ve added any patches or updates! + +```c +#include <stdio.h> + +int main() { + printf("Coder is broken\n"); + return 0; +} +``` + +Thanks for checking out my work! And as always, remember: + +MAY THE ODS BE EVER IN YOUR FAVOUR!!! + +Cheers, +DANIEL KIBBLEWHITE + -- GitLab