From 2964c518538fae273d23311d51a8cf640a139833 Mon Sep 17 00:00:00 2001 From: Minseong Gwak Date: Wed, 7 Jan 2026 17:03:22 +0900 Subject: [PATCH] update: specifiy kernel version & update readme --- .gitmodules | 1 + README.md | 62 ++++++++++++++++++++++++++++++++--------------------- linux | 2 +- 3 files changed, 40 insertions(+), 25 deletions(-) diff --git a/.gitmodules b/.gitmodules index ff1e9cc..e193a77 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "linux"] path = linux url = https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git + branch = linux-6.6.y diff --git a/README.md b/README.md index c81b3ee..5dec482 100644 --- a/README.md +++ b/README.md @@ -6,34 +6,17 @@ sudo apt install qemu-system-x86 grub-pc-bin e2fsprogs ``` -## Run +## Build ```bash -gcc -static -o init/init init/init.c +git clone +cd kernel-study -dd if=/dev/zero of=disk.img bs=1M count=512 status=none -echo -e "n\np\n1\n2048\n\nw" | fdisk disk.img > /dev/null - -dd if=disk.img of=part.img bs=512 skip=2048 status=none - -mkfs.ext4 part.img -debugfs -w -R "mkdir /boot" part.img -debugfs -w -R "mkdir /boot/grub" part.img - -debugfs -w -R "write init/init /init" part.img -debugfs -w -R "write linux/arch/x86/boot/bzImage /boot/bzImage" part.img -debugfs -w -R "write grub/grub.cfg /boot/grub/grub.cfg" part.img - -dd if=part.img of=disk.img bs=512 seek=2048 conv=notrunc status=none - -``` - -Or, alternatively - -```bash +git submodule update --init --recursive --remote --depth 1 make ``` + ## disk.img structure ### 1. 디스크 전체 구조도 (Overview) @@ -119,7 +102,7 @@ Sec 0 Sec 1 Sec 2048 Sec 526336 Sec 7 | **Free** | 788480 | 403,701,760 | 127 MB | (사용 안 함) | -# `make run` +## `make run` ```bash ifconfig eth0 10.0.2.15 @@ -133,4 +116,35 @@ Host: 1.1.1.1 :q nc 1.1.1.1 80 < req.txt -``` \ No newline at end of file +``` + + + +## Legacy +### Run + +```bash +gcc -static -o init/init init/init.c + +dd if=/dev/zero of=disk.img bs=1M count=512 status=none +echo -e "n\np\n1\n2048\n\nw" | fdisk disk.img > /dev/null + +dd if=disk.img of=part.img bs=512 skip=2048 status=none + +mkfs.ext4 part.img +debugfs -w -R "mkdir /boot" part.img +debugfs -w -R "mkdir /boot/grub" part.img + +debugfs -w -R "write init/init /init" part.img +debugfs -w -R "write linux/arch/x86/boot/bzImage /boot/bzImage" part.img +debugfs -w -R "write grub/grub.cfg /boot/grub/grub.cfg" part.img + +dd if=part.img of=disk.img bs=512 seek=2048 conv=notrunc status=none + +``` + +Or, alternatively + +```bash +make +``` diff --git a/linux b/linux index 9448598..5fa4793 160000 --- a/linux +++ b/linux @@ -1 +1 @@ -Subproject commit 9448598b22c50c8a5bb77a9103e2d49f134c9578 +Subproject commit 5fa4793a2d2d70ad08b85387b41020f1fcc2d19e