首页 Home.
-
自制操作系统(1):内核Hello world 注:这篇文章并不完整,因为我一开始没打算记录制作的全过程,所以一开始并没有写这一章...后面会把它补充完整,请见谅。 全程参考:https://osdev.wiki/wiki/Multiboot1_Bare_Bones。 毫不避讳地说,Bare bone这里AI帮我写了绝大部分的代码,因为:1、这部分代码不多,而且绝大部分在后面会被替代;2、我没有进行过内核编程,我不想太过苛求自己,让自己一开始就困在各种报错和调试中,为自己带来太多的挫败感;3、我想先让自己能尽快“看到点什么”——反馈是很重要的! 开发环境 WSL2+VSCode 准备工作:交叉 […]
2026年2月7日 80 次浏览 -
自制操作系统(0):开始与结束的序言 这篇序言本应该是最开始就写好的,但实际上它是最后一篇写好的,所以叫”开始与结束的序言”。 阅读下面这一系列的文章,你会看到我在实现这个操作系统过程中的一些想法。理想化地想,我想展示的是好的东西,包括看到一个庞然大物是如何从无到有的,而且每一步都有所见即所得的反馈;但现实总不是那么理想,这里面当然也有不好的东西,包括一时的纠结、挣扎,以及无奈妥协… 需要注意的是,这一系列文章可能难称得上是什么教程。 硬要说,这些只是我的一些思绪的记录和学习的笔记——在此之前,我没有哪怕一行的内核编程经验。记录这一切的目的是:我想跟大家分享开发操作系统的乐趣。当然乐趣并不意味 […]
2026年2月6日 69 次浏览 -
博客历经半年沉寂再度复活!因服务器到期及备案波折,虽遭遇数据库丢失惨剧,终靠老备份与AI辅助完成重构。
2026年2月5日 576 次浏览 -
1. ``` root@C202511211157657:~# python3 segmentation.py -a 128 -p 512 -b 0 -l 20 -B 512 -L 20 -s 0 ARG seed 0 ARG address space size 128 ARG phys mem size 512 Segment register information: Segment 0 base (grows positive) : 0x00000000 (decimal 0) Segment 0 limit : 20 Segment 1 base (grows negative) : […]
2025年12月9日 12 次浏览 -
1. ``` root@C202511211157657:~# python3 relocation.py -s 1 ARG seed 1 ARG address space size 1k ARG phys mem size 16k Base-and-Bounds register information: Base : 0x0000363c (decimal 13884) Limit : 290 Virtual Address Trace VA 0: 0x0000030e (decimal: 782) --> PA or segmentation violation? VA 1: 0x00 […]
2025年12月3日 1 次浏览 -
1. ``` root@C202511211157657:~# tar xvzf HW-Lottery.tgz ./._lottery.py lottery.py ./._README-lottery README-lottery root@C202511211157657:~# python3 lottery.py ARG jlist ARG jobs 3 ARG maxlen 10 ARG maxticket 100 ARG quantum 1 ARG seed 0 Here is the job list, with the run time of each job: Job 0 ( l […]
2025年11月27日 8 次浏览 -
Select Homework for Chapter 8 of 《Operating Systems: Three Easy Pieces》: MLFQ Scheduling 1 ``` root@C202511211157657:~# python3 mlfq.py -j 2 -M 0 -m 4 -n 2 -q 1 Here is the list of inputs: OPTIONS jobs 2 OPTIONS queues 2 OPTIONS allotments for queue 1 is 1 OPTIONS quantum length for queue 1 is 1 OPT […]
2025年11月26日 8 次浏览 -
### Concepts: the "response time" (the time a job spends waiting after arrival before first running); the "turnaround time" (the time it took to complete the job since first arrival); the total "wait time" (any time spent ready but not running). 1&2: I will simply combine both of 2 questions and dra […]
2025年11月24日 7 次浏览 -
We used Deepseek and Chatgpt to generate the code we use to measure. ### 1. Time cost of syscall: ```c /** * System Call Overhead Measurement * Measures the time cost of a zero-byte read system call * Uses clock_gettime with MONOTONIC clock for precise timing * Binds process to single CPU for consis […]
2025年11月23日 6 次浏览 -
1.Let's see what if we change the variant v separately. ```c root@C202511211157657:~# gcc main.c -o a.out root@C202511211157657:~# cat main.c #include #include #include #include #include #include int main(int argc, char *argv[]) { int v = 0; int rc = fork(); if (rc < 0) { // fork failed; exit fprint […]
2025年11月22日 6 次浏览
