OS/OS from Scratch
[OS] 00. 강좌 소개와 Environment 구성
jschang
2021. 6. 20. 13:26
OS를 처음부터 만들어 볼 수 있는 Github Repository를 찾아 이에 관한 해설 글들을 올리려 합니다. Github 링크는 다음과 같습니다. 사용하는 언어는 Assembly와 C언어이며, Assembly는 코드가 나올 때마다 구글링을 통해 알아가도 충분할 것 같습니다.
https://github.com/cfenollosa/os-tutorial
cfenollosa/os-tutorial
How to create an OS from scratch. Contribute to cfenollosa/os-tutorial development by creating an account on GitHub.
github.com
먼저 환경 구성입니다. 본 튜토리얼에서는 Nasm과 QEMU를 이용해 실습합니다.
QEMU는 bin파일을 실행시키므로 Nasm을 이용해 Assembly 코드를 bin파일로 컴파일해야 합니다. Nasm을 이용해 Assembly 코드를 컴파일 하는 명령어는 다음과 같습니다.
nasm -f bin <Assembly 파일명>.asm -o <생성할 bin 파일명>.bin
QEMU는 VirutalBox같은 가상 머신입니다. 저는 WSL환경에 qemu-system-x86_64를 설치하고 사용하고 있습니다. QEMU를 사용하는 명령어는 다음과 같습니다.
qemu-system-x86_64 -drive format=raw,file=<파일명>.bin --nographic
QEMU를 터미널에서 종료시키기 위해서는 Ctrl-a를 한 후 x를 입력하면 강제 종료할 수 있습니다.
다음 강좌부터는 Boot Sector를 만들어보겠습니다.