OS
-
[Multithreaded Kernel] 2-1. Protected ModeOS/Multi-threaded Kernel from Scratch 2021. 8. 23. 12:27
서론 이번 글에서는 32bit protected mode 개발에 대해 다루겠습니다. 에 대해 알아보겠습니다. 이론 Protected Mode Protected Mode에서는 다음 기능을 지원합니다. 메모리&하드웨어 보호 각 프로세스에 대한 접근 제한 설정 가능 (Ring 0, Ring 1, ...; Ring 0: Kernel) 다양한 메모리 Scheme Segmentation 레지스터가 차지하는 메모리 범위와 접근 권한을 담은 특정 자료구조를 가리킴 Paging: 가상 주소가 실제 주소를 가리키게 함 4Gb 메모리 사용 가능 (Real Mode에서는 1Mb만 사용 가능했음) Protected Mode로 진입하는 순서는 다음과 같습니다. Interrupt 비활성화 GDT Load CPU의 control 레..
-
[Multithreaded Kernel] 1. Real ModeOS/Multi-threaded Kernel from Scratch 2021. 8. 1. 23:18
서론 이번 글에서는 16bit real mode 개발에 대해 다루겠습니다. Bootloader, Segmentation, BPB, Interrupt Vector Table, Disk I/O에 대해 알아보겠습니다. 이론 Bios & Bootloader Bios는 ROM(Read Only Memory)에 상주하는 프로그램으로써 하드웨어들을 초기화/점검하고 Bootloader을 불러오며, Bootloader는 Kernel을 불러옵니다. 컴퓨터가 켜지면서 Bios는 스스로 RAM위에 올려져 실행됩니다. Bios는 16bit code만 실행 가능 Bios는 Bootloader를 불러오기 위해 모든 저장장치(하드디스크, USB, Floppu Disk etc)들의 첫 번째 Sector를 확인하면서 Boot Signa..
-
[Multi-threaded Kernel] 0. Basic AssemblyOS/Multi-threaded Kernel from Scratch 2021. 7. 29. 18:03
서론 이번 강의에서 Kernel 개발을 위해 필요한 Assembly 문법을 배워보겠습니다. 이론 Register ax ah (High Byte) al (Low Byte) ip: 현재 진행되고 있는 instruction의 주소 가리킴 sp: Stack 포인터 ds: Data Segment Assembly에서 메모리 주소에 접근할 때 Data Segment 고려 절대 주소 계산: (ds값)*16+offset 메모리 주소가 매우 크기 때문에 하나의 레지스터로 표현 못하기 때문 ss: Stack Segment cs: Code Segment org 100h 작성한 프로그램이 해당 메모리 주소(100h; h: 16진수)에 불러오게 하여 offset 설정 int 10h 10h Interrupt 호출; 10h: 화면에..
-
[OS] 23. FinishOS/OS from Scratch 2021. 7. 29. 13:51
서론 이번 강의에서는 간단한 오류들을 수정하여 OS를 완성하겠습니다. 해당 Github 강의는 다음과 같습니다. https://github.com/cfenollosa/os-tutorial/tree/master/23-fixes GitHub - cfenollosa/os-tutorial: How to create an OS from scratch How to create an OS from scratch. Contribute to cfenollosa/os-tutorial development by creating an account on GitHub. github.com 이론 Github 사용법 Github에 프로젝트를 올리기 위해서는 먼저 Github 사이트에서 Repository를 만듭니다. 다음으로 프로..
-
[OS] 22. MallocOS/OS from Scratch 2021. 7. 24. 20:40
서론 이번 강의에서는 간단한 malloc 함수를 구현하겠습니다. 해당 Github 강의는 다음과 같습니다. https://github.com/cfenollosa/os-tutorial/tree/master/22-malloc GitHub - cfenollosa/os-tutorial: How to create an OS from scratch How to create an OS from scratch. Contribute to cfenollosa/os-tutorial development by creating an account on GitHub. github.com 이론 Paging 기법 컴퓨터는 메모리를 가상 메모리로서 관리하는데, 이를 통해 실제 메모리를 추상화해 프로세스들이 연속된 메모리를 사용하는 것..
-
[OS] 21. ShellOS/OS from Scratch 2021. 7. 23. 16:30
서론 이번 강의에서는 작성했던 코드를 정리하고 가장 기본적인 Shell을 구현하겠습니다. 해당 Github 강의는 다음과 같습니다. https://github.com/cfenollosa/os-tutorial/tree/master/21-shell GitHub - cfenollosa/os-tutorial: How to create an OS from scratch How to create an OS from scratch. Contribute to cfenollosa/os-tutorial development by creating an account on GitHub. github.com 코드 이번 강의에서는 위 Github 링크에서 설명하는 대로 파일의 경로들을 재설정하고, 단순 구현을 진행합니다. 코드를..
-
[OS] 20. Interrupt-timerOS/OS from Scratch 2021. 7. 18. 00:27
서론 이번 강의에서는 CPU Timer와 키보드 Interrupt를 구현하겠습니다. 해당 Github 강의는 다음과 같습니다. https://github.com/cfenollosa/os-tutorial/tree/master/20-interrupts-timer cfenollosa/os-tutorial How to create an OS from scratch. Contribute to cfenollosa/os-tutorial development by creating an account on GitHub. github.com 이론 PIT (Programmable Interval Timer) PIT chip(문서)은 oscillator, prescaler, frequency dividers로 구성되며, fr..
-
[OS] 19. Interrupt-irqsOS/OS from Scratch 2021. 7. 12. 00:57
서론 이번 강의에서는 Interrupt Request를 구현하겠습니다. 해당 Github 강의는 다음과 같습니다. https://github.com/cfenollosa/os-tutorial/tree/master/19-interrupts-irqs cfenollosa/os-tutorial How to create an OS from scratch. Contribute to cfenollosa/os-tutorial development by creating an account on GitHub. github.com 이론 Computer Buses 버스에 대한 좋은 동영상이 있어 첨부합니다. Computer Bus 버스는 데이터 버스, 주소 버스, 제어 버스로 나뉩니다. 데이터 버스: 데이터 버스는 데이터가 이..