KangMoo
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 운영체제 ## 운영체제란? ![](https://i.imgur.com/bNvG27j.png) - 컴퓨터 하드웨어와 소프트웨어 리소스를 관리하고, 사용자와 컴퓨터 사이의 인터페이스 역할을 하는 시스템 소프트웨어 - 자원을 효율적으로 관리하고, 사용자와 시스템 간의 상호 작용을 용이하게 하며, 애플리케이션 실행에 필요한 환경을 제공한다. - 컴퓨터의 기본적인 기능을 제어하며, 프로그램 실행, 파일 관리, 메모리 관리, 입출력 관리 등 다양한 기능을 제공한다 - 운영체제도 프로그램이기 때문에 여타 프로그램들과 같이 메모리에 적재된다 > 운영체제를 알아야 하는 이유 > > - 운영체제는 사용자를 위한 프로그램이라기 보다 프로그램을 위한 프로그램이라고 할 수 있다 > - 따라서 프로그램을 만드는 개발자는 운영체제의 동작 원리를 알아야 한다 ### 운영체제의 목적 - 프로세스 관리: 프로세스의 생성, 스케줄링, 종료 등을 관리한다. - 메모리 관리: 프로그램이 실행될 때 필요한 메모리 공간을 할당하고, 사용이 끝난 메모리를 회수한다. - 파일 시스템 관리: 파일 생성, 삭제, 수정 등의 파일 시스템 관리 기능을 제공한다. - 입출력 시스템 관리: 키보드, 마우스, 프린터 등 다양한 입출력 장치를 관리한다. - 보안 및 접근 제어: 시스템의 보안을 유지하고, 사용자의 접근을 제어한다. ### 운영체제의 핵심 서비스 - 자원 접근 및 할당 - CPU 스케쥴링 : 어떤 프로세스를 먼저, 얼마나 오래 실행시킬지 - 메모리 : 페이징, 스와핑 - 입출력 장치 : 인터럽트 서비스 루틴 - 파일 시스템 관리 - 관련된 정보를 파일이라는 단위로 저장 장치에 보관 - 파일들을 묶어 폴더(디렉토리) 단위로 저장 장치에 보관 ## 커널 ![](https://hackmd.io/_uploads/SJaqtj-Ta.png) - 운영체제의 핵심 서비스를 담당하는 부분을 커널이라고 부른다 - 운영체제의 심장이라고 한다 - 핵심 서비스 : 프로세스 관리, 메모리 관리, 파일 시스템 관리, 입출력 관리 등 ### 이중모드와 시스템 호출 - 사용자가 실행하는 프로그램은 자원에 직접 접근할 수 없다 - 이를 위반하면 시스템이 불안정해질 수 있다 - 예를 들어 두 프로세스가 하나의 파일에 쓰기 작업을 할 경우, 파일의 내용이 꼬일 수 있다. (덮어쓰기 등 발생 가능) - 운영체제는 응용프로그램들이 자원에 접근하려 할 때, **오직 자신을 통해서만 접근을 가능하도록 하여 작원을 보호**한다. - 자원에 접근하려면 운영체제의 도움을 요청(= 운영체제의 코드를 실행) 해야한다. ### 이중모드란? ![](https://hackmd.io/_uploads/BkYtNt4aT.png) - CPU가 명령을 실행하는 모드를 **사용자 모드**와 **커널 모드**로 구분하는 방식 - 사용자 모드 - 운영체제의 서비스를 제공받을 수 없는 실행 모드 - 커널 영역의 코드를 실행할 수 없는 실행 모드 - 자원 접근 불가 - 커널 모드 - 운영체제의 서비스를 제공받을 수 있는 실행 모드 - 자원 접근을 비롯한 모든 명령어 실행 가능 ### 시스템 호출 ![image](https://hackmd.io/_uploads/HyqJ6iZTa.png) - 커널모드로 전환하여 실행하기 위한 호출 - 운영체제 서비스를 제공받기 위해 커널모드로 전환하려면 시스템 호출을 사용해서 커널모드로 전환한다. - ![image](https://hackmd.io/_uploads/Hy2j5iWaT.png) - 시스템 호출은 인터럽트를 발생시켜 커널모드로 전환한다. - 인터럽트 : CPU가 프로그램을 실행하고 있을 때, 입출력 하드웨어 등의 장치나 예외상황이 발생하여 처리가 필요할 때, 현재 실행중인 프로그램을 중단하고, 운영체제의 코드를 실행하는 것 - ![image](https://hackmd.io/_uploads/H10nJ3-ap.png) - 일반적으로 실행하는 프로그램은 자원에 빈번하게 접근하기 때문에 시스템 호출을 많이 사용한다. - ![image](https://hackmd.io/_uploads/r177l2Wap.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully