OS_04_1 Computer Hardware and OS

saewoohan·2023년 7월 28일
0

OS

목록 보기
2/19
post-thumbnail

OS_04_1 Computer Hardware and OS

1. Computer Organization and Instruction Processing

1) Computer System Elements

  • Processor
    • system 명령을 수행
  • Main Memory
    • 휘발성, 하지만 data와 program들을 저장한다.
    • ‘real memory’나 ‘primary memory’라고도 불린다.
  • I/O Modules
    • 컴퓨터와 외부 환경 사이에 data가 이동하는 것이다.
  • System Bus
    • processor, main memory, I/O module사이에 통신을 용이하게 한다.

2) The von Neumann model

  • stored program이라는 개념을 도입하였다.
  • Processing Unit + Control Unit → CPU
  • Memory → Memory

3) Memory

a. 개요

  • 2k x m array of stored bits
    • Address → 위치를 찾기 위한 identifier이다. (k의 bit)
    • Contents(data) → 해당 위치에 저장되어 있는 m-bit의 value이다.
  • Basic Operation
    • Load
    • Store

b. Interface to Memory

  • 그렇다면 processing unit은 memory부터 data를 어떻게 얻거나 주는가?
    • MAR : Memory Address Register
    • MDR : Memory Data Register
  • LOAD (location → A)
    • 주소 A를 MAR에 쓴다. (주소 값을 구해줌)
    • ‘read’ signal을 memory에 보내준다.
    • MDR로 부터 data를 읽는다. (해당 주소값에 저장되어 있는 data를 fetching)
  • STORE (value → X and location → A)
    • data X를 MDR에 쓴다. (data register에 저장하려는 값을 저장한다.)
    • MAR에 address A를 쓴다. (주소 값을 구해줌)
    • ‘write’ signal을 memory에 보내준다.

4) Processing Unit and Control Unit

  • Processing Unit
    • ALU = Arithmetic and logic unit
    • TEMP (registers) → operand를 저장하는 용도.
  • Control Unit
    • Instruction Register (IR) → 현재의 instruction을 포함한다. (add instruction 기억)
    • Program Counter (PC) → 다음에 실행 될 instruction의 주소를 포함한다.

2. Program Execution

1) The Concept of Programming

  • CPU를 machine language를 통해서 말할 수 있다.
    • 이는, CPU는 오직 instruction들만 이해하고 실행시킬 수 있음을 뜻한다.
  • 즉, instruction은 processor에 주어진 명령이다.
  • “Programming”의 의미는
    • 명령어들을 실행할 일련의 계획을 세우는 것.
    • 이 결과를 “program”이라고 부른다.

2) Assembly Programming

  • assembly instruction을 사용해서 programming하는 것.
    • machine instruction과 1:1 대응 관계이다.

3) Program and Languages

  • Assembly programming은 어렵고 지루하다.
    • 그래서 HLL을 사용한다.
    • High-level language → Assembly code → Machine Instructions

4) Programming I/O Devices

  • 각각의 I/O device는 각자의 controller 혹은 interface를 가진다. (PCB)
  • CPU는 해당 4가지를 통해 I/O controller와 통신을 진행한다.
    • Control register : write commands
    • Status register : read the device’s internal state
    • Input register : fetch data
    • Output register : write data

0개의 댓글