update: specifiy kernel version & update readme
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
[submodule "linux"]
|
[submodule "linux"]
|
||||||
path = linux
|
path = linux
|
||||||
url = https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
|
url = https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
|
||||||
|
branch = linux-6.6.y
|
||||||
|
|||||||
@@ -6,34 +6,17 @@
|
|||||||
sudo apt install qemu-system-x86 grub-pc-bin e2fsprogs
|
sudo apt install qemu-system-x86 grub-pc-bin e2fsprogs
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run
|
## Build
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
gcc -static -o init/init init/init.c
|
git clone <REPOSITORY_URL>
|
||||||
|
cd kernel-study
|
||||||
|
|
||||||
dd if=/dev/zero of=disk.img bs=1M count=512 status=none
|
git submodule update --init --recursive --remote --depth 1
|
||||||
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
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## disk.img structure
|
## disk.img structure
|
||||||
### 1. 디스크 전체 구조도 (Overview)
|
### 1. 디스크 전체 구조도 (Overview)
|
||||||
|
|
||||||
@@ -119,7 +102,7 @@ Sec 0 Sec 1 Sec 2048 Sec 526336 Sec 7
|
|||||||
| **Free** | 788480 | 403,701,760 | 127 MB | (사용 안 함) |
|
| **Free** | 788480 | 403,701,760 | 127 MB | (사용 안 함) |
|
||||||
|
|
||||||
|
|
||||||
# `make run`
|
## `make run`
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ifconfig eth0 10.0.2.15
|
ifconfig eth0 10.0.2.15
|
||||||
@@ -133,4 +116,35 @@ Host: 1.1.1.1
|
|||||||
:q
|
:q
|
||||||
|
|
||||||
nc 1.1.1.1 80 < req.txt
|
nc 1.1.1.1 80 < req.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 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
|
||||||
|
```
|
||||||
|
|||||||
+1
-1
Submodule linux updated: 9448598b22...5fa4793a2d
Reference in New Issue
Block a user