Unit 12.1 Operating System
The Jack OS: Math/Memory/Screen/Output/Keyboard/String/Array/Sys
Unit 12.2 Efficiency Matters
Use logarithmic runtime algorithms instead of linear runtime algorithms.
Unit 12.3 Operating System: Mathematical Operations
Implementation notes:
Unit 12.4 Operating System: Memory Access
Unit 12.5 Operating System: Heap Management
🎈 Fragment recycle algorithm is not required, but it’s a nice extension for this OS.
Unit 12.6 Graphics
Vector graphics images can be easily:
- stored
- transmitted
- scaled
- turned into bitmap
Unit 12.7 Operating System: Line Drawing
Line drawing:
- drawLine is implemented through a sequence of drawPixel operations
- In each stage we have to decide if we have to go right, or up
Unit 12.8 Operating System: Handling Textual Output
Hack font:
- Each character occupies a fixed 11-pixel high and 8-pixel wide frame
- The frame includes 2 empty right columns and 1 empty bottom row for character spacing
About cursor, must be managed as follows:
- if asked to display newLine: move the cursor to the beginning of the next line
- if asked to display backspace: move the cursor one column left
- if asked to display any other character: display the character, and move the cursor one column to the right
Unit 12.9 Operating System: Input
Keyboard memory map:
- when a key is pressed on the keyboard, the keyboard register is set to the key’s scan code
- when no key is pressed, the keyboard register is set to 0
Unit 12.10 Operating System: String Processing
Unit 12.11 Operating System: Array Processing
Unit 12.12 Operating System: The Sys Class
Unit 12.13 Project 12: Building the OS
Emmmm…after some thought, i would not display my codes for this project.😁
Unit 12.14 Perspective
- What are the major differences between the jack operating system and regular systems?
- jack is very easy and limited functionality compared to industrial strength systems.
- How come the Jack OS is so wide open programmer can do whatever they want?
- Everything is wide open in nand2tetris, so users can do everything they want. And yet in Hack platform, the user level code and OS code run in exactly the same execution level.
- How does the Jack OS rate in terms of efficiency?
- Two areas: mathematical operations and graphics.