크래프톤 정글 일지

[PintOS] User Programs 개요

나한나한나한나 2024. 5. 20. 22:02

The base code already supports loading and running user programs,

but no I/O or interactivity is possible.

In this project, you will enable programs to interact with the OS via system calls.

 

지금까지 Pintos에서 실행한 모든 코드는 운영 체제 커널의 일부

그러니까 지금까지는 full access로 시스템에 접근했지만, 앞으로는 아닐 것

 

Each process has one thread - 멀티쓰레드 없음

 

User programs are written under the illusion that they have the entire machine.

when you load and run multiple processes at a time, you must manage memory, scheduling, and other state correctly to maintain this illusion.

 

You must make sure that the user program interface meets the specifications described here, but 커널 코드 니맘대로 변경 가능

 

In 'userprog'

  • process.c, process.h
    • Loads ELF(실행파일, Executable and Linkable Format) binaries and starts processes
  • exception.c, exception.h
    • When a user process performs a privileged or prohibited operation, it traps into the kernel as an “exception” or “fault.”
    • These files handle exceptions.

 

file system code 만질 필요 없음

 

No internal synchronization. Concurrent accesses will interfere with one another. You should use synchronization to ensure that only one process at a time is executing file system code.