ComputerScience(103)
-
[OS Project] Chap10-1. Process - PCB and Context switch
ProcessA process is an instance of an application. Each process has its own independent execution context and resources, such as a virtual address space. Practical operating systems provide the execution context as a separate concept called a "thread". For simplicity, in this book we'll treat each process as having a single thread. Process control block The following process structure defines ..
2025.01.19 -
[OS Project] Chap9. Memory Allocation
Memory AllocationBefore implementing a memory allocator, let's define the memory regions to be managed by the allocator . = ALIGN(4); . += 128 * 1024; /* 128KB */ __stack_top = .; . = ALIGN(4096); __free_ram = .; . += 64 * 1024 * 1024; /* 64MB */ __free_ram_end = .;} This adds two new symbols, __free_ram and __free_ram_end. This defines a memory area after the stack space. ..
2025.01.18 -
[OS Project] Chap8. Exception
ExceptionException is a CPU feature that allows the kernel to handle various events, such as invalid memory access (aka. page faults), illegal instructions, and system calls. Exception is like a hardware-assisted try-catch mechanism in C++ or Java. Until CPU encounters the situation where kernel intervention is required, it continues to execute the program. The key difference from try-catch is ..
2025.01.17 -
[OS Project] Chap7. Kernel Panic
Kernel PanicA kernel panic occurs when the kernel encounters an unrecoverable error, similar to the concept of panic in Go or Rust. Have you ever seen a blue screen on Windows? Let's implement the same concept in our kernel to handle fatal errors. The following PANIC macro is the implementation of kernel panic#define PANIC(fmt, ...) \ do ..
2025.01.17 -
[OS Project] Chap6. C Standard Library
C Standard LibraryIn this chapter, let's implement basic types and memory operations, as well as string manipulation functions. In this book, for the purpose of learning, we'll create these from scratch instead of using C standard library. The concepts introduced in this chapter are very common in C programming, so ChatGPT would provide solid answers. If you struggle with implementation or under..
2025.01.17 -
[OS Project] Chap5. Hello World!
Say "hello" to SBI- SBI is an "API for OS". - To call the SBI to use its function, we use the ecall instruction#include "kernel.h"extern char __bss[], __bss_end[], __stack_top[];struct sbiret sbi_call(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long fid, long eid) { register long a0 __asm__("a0") = arg0; register long a1 __asm__("a1") = arg1; ..
2025.01.16 -
[OS Project] Chap4. Booting the Kernel
2024. 01. 13. Monday ์ฐ์ ํ๋ก์ ํธ๋ฅผ ์๊ฒฉ์ผ๋ก ์ฐ๊ฒฐํด๋์๋ค. :) GitHub Desktop ์ฑ๋ ์ค๋๋ง์ ๋ค์ด๊ฐ๋ณธ๋ค , , https://github.com/SohyeonKim-dev/OperatingSystem GitHub - SohyeonKim-dev/OperatingSystem: OS ๋ง๋ค๊ธฐ ํ๋ก์ ํธOS ๋ง๋ค๊ธฐ ํ๋ก์ ํธ . Contribute to SohyeonKim-dev/OperatingSystem development by creating an account on GitHub.github.com ๐ฉ๐ป brew๋ก qemu ์ค์น brew install llvm lld qemu Let's boot OpenSBI OpenSBI: Open Sourc..
2025.01.13 -
[OS Project] ์ด์์ฒด์ ๊ตฌํํ๊ธฐ ํ๋ก์ ํธ
2025. 01. 10 Friday ์ด์ Geek News์์ ์ฌ๋ฏธ์์ด ๋ณด์ด๋ ํ๋ก์ ํธ๋ฅผ ์ฐพ๊ฒ ๋์๋ค.! ๐ฉ๐ป์ ๋๋ก ๋ ์ฝ๋ฉ์ ํ ๊ฒ . . ์ง๋ ๊ฒจ์ธ ๋ฐฉํ๋ ํ์ฐฝ ์ฑ ๊ฐ๋ฐํ๋ ๊ทธ ์์ ์ด ๋ง์ง๋ง์ธ ๊ฒ ๊ฐ๊ฑฐ๋ฑ์ ^^.. ...๐ฅ๋ฌด์ธ๊ฐ ๋ง๋ค๊ณ ์ถ์๊ฒ ์์ด์,ํ๋ฐ๋ฐ ๋ฐค์ ๊ฐ๋ฐํ๋ ๋๊ฐ ๊ทธ๋ฆฝ๊ธฐ๋ ํ๊ณ ,, ์์ฆ์ ํ๊ณ ์ถ์ ์ผ๋ณด๋ค ํด์ผํ๋ ์ผ์ ๋ ๋ง์ด ํ๊ฒ ๋๋ ๊ฒ ๊ฐ๋ค์ .. .·โ(โ_โ)โ·. https://operating-system-in-1000-lines.vercel.app/en/ Intro | OS in 1,000 Lines operating-system-in-1000-lines.vercel.app์ธ์์๋ ๋๋จํ ๊ฐ๋ฐ์๊ฐ ๋๋ฌด๋๋ฌด๋ง์ผ์ - ..
2025.01.10 -
[Pin] Encoding Memory Visualization
2024. 10. 22 TuesdayVisualizatinon - Text memory + CPU Cycle # Summary ์ ์ ์ผ๋ก ์ปดํ์ผ ๋ ์ฝ๋ -> objdump๋ก ํ์ธ ๋์ ์ผ๋ก ์ฐ๊ฒฐ -> ์ฝ๋ ์์์ ํ๋ฆฐํธ ์ฐ์ด์ ํ์ธ ๋์ ์ด๋ ์ ์ ์ด๋ ๊ตฌ๋ถํด์ ๋ถ์ํ๋ ๊ฒ ์ค์DLL์ด๋์ ๋ค๋ฅธ ๋ด์ฉ Rust ์ฝ๋์์ print ๊ตฌ๋ฌธ์ผ๋ก text ์ฃผ์ ํ์ธํ๊ธฐ 16์ง์ ๋ฉ๋ชจ๋ฆฌ -> 100 ๋จ์๋ ๋งค์ฐ ํฐ scale csv ํ์ผ -> Python์ผ๋ก ์๊ฐํ at Web - Plotly https://plotly.com/python/ PlotlyPlotly'splotly.com https://github.com/plotly/plotly.py GitHub - plotly/plotly.py: The in..
2024.10.22 -
[Pin] CoreBPE Memory Tracing by pinatrace
https://stackoverflow.com/questions/32026456/how-can-i-specify-an-area-of-code-to-instrument-it-by-pintool How can i specify an area of code to instrument it by pintool?There are four levels of granularity in Pin: routine, instruction and image, trace. Can i specify an limits/area to start and stop inserting instrumentation code. may by like directive like ( # startstackoverflow.com # ์์ฃผ ์ผ๋..
2024.10.15