전체 보기

    [LKM] procfs & seq_file

    Kernel version: 5.14.17 procfs이란? procfs는 proc + fs = process file system의 약자다. 모든 것을 파일로 취급하는 유닉스 사상에 따라 이 특별한 파일 시스템은 시스템 내의 정보를 제공하기 위해 존재한다. 실제로 존재하는 하드웨어에 대한 파일 시스템이 아닌 메모리 상에서만 존재하고, 가상 파일 시스템(VFS)의 인터페이스의 형태이며 /proc 경로에 마운트 되어 사용된다. 예전에 정리했던 포스팅에서도 아주 잠깐 다룬 적이 있다. [wikipedia] "ls /proc" 명령어를 사용해보면 뭔가 많이 있는 것을 확인할 수 있다. 숫자로 된 디렉터리들은 현재 올라가 있는 프로세스들의 PID를 나타내고, 나머지들도 각자의 결과를 반환하는 역할을 하는 함수들..

    [Network Programming with Rust] Week 6

    Assigned Pages: 236 ~ 240p / 117 ~ 126p Appendix - Awaiting the future 해당 책으로는 더 이상 나가지 않고 추가적으로 공부를 더 하기 위해 스터디원끼리 토의를 통해 「Rust for Rustaceans」 책의 비동기 부분을 더 공부하기로 했다. Chap 8. ASYNCHRONOUS PROGRAMMING The contents I wrote with markdown are in github repository. Here is the link.

    [LKM] Character Device Driver

    Kernel version: 5.14.17 What is a device driver? device driver는 하나의 컴퓨터 프로그램이다. 컴퓨터나 오토마톤에 접목되어 특정 타입의 device를 동작시키거나 조종한다. device는 우리가 생각하는 여러 주변 하드웨어 기기들을 일컫는 말이다. 키보드, 마우스, 모니터, USB,... 등등 많은 종류의 하드웨어가 컴퓨터와 통신하는데 주로 sequential bytes의 형태로 이루어진다. 이 말은 즉 linux에서는 모든 devices가 file이라고 본다. ([Kernel of Linux] 강의 정리 내용을 참고하자.) 결국 우리가 만들게 될 device driver는 device라는 하나의 파일을 컨트롤하기 위한 프로그램을 만드는 것이다. devic..

    [Network Programming with Rust] Week 5

    Assigned Pages: 183~190p Chapter 7. Asynchronous Network Programming Using Tokio [Part] Heading to tokio - Socket multiplexing in tokio The contents I wrote with markdown are in github repository. Here is the link.

    [Network Programming with Rust] Week 4

    Assigned Pages: 155~159p Chapter 6. Taking HTTP in the Internet [Part] Introducing reqwest The contents I wrote with markdown are in github repository. Here is the link.

    [Network Programming with Rust] Week 3

    Assigned Pages: 95~101p Chapter 4. Data Serialization, Deserialization, and Parsing [Part] Custom serialization and deserialization The contents I wrote with markdown are in github repository. Here is the link.

    [Kernel of Linux] 14. Memory Management

    지난 강의 요약 - File System (3) Linux는 Unix와는 달리 많은 종류의 FS을 커버할 수 있도록 만들어졌다. 그래서 실제 physical FS layer 위에 유저를 위한 standard를 제공하기 위한 VFS(Virtual FS) layer를 얹어놨다. VFS는 standard objects 4가지를 통해 어떤 FS든지 정의할 수 있도록 했다. superblock object / inode object / file object / dentry object. dentry를 제외한 나머지 object들은 이전에도 많이 했으니 넘어가고 dentry에 대해 알아보자. dentry는 directory entry로 단순히 말해 path(name) components의 inode를 저장하는 것을..

    [Kernel of Linux] 13. File System (3)

    지난 강의 요약 - File System (2) 디스크는 inode와 data를 저장하는 부분으로 나뉘어 있다. inode 0번째는 root directory를 의미한다. open("/a/b") 이렇게 시스템 콜이 불렸다면 처음에 root directory file을 열어서 밑에 있는 inode 포인터 리스트를 가져온다. 파일 중 a file을 가리키는 inode 포인터를 찾았다면 또 거기서 아래로 내려가 찾는다. 그렇게 b file까지 오게 되면 b를 위한 offset을 저장할 file struct를 만들고 나서 이를 가리키는 포인터를 커널에 있는 u_ofile[] array에 저장한다. 포인터를 저장한 이 array의 index를 바로 fd(file descriptor)라고 한다. 디스크에 데이터를 ..

    [Network Programming with Rust] Week 2

    맡은 범위: 71~76p Chapter 3. TCP and UDP Using Rust The contents I wrote with markdown are in github repository. Here is the link.