COSC 423 - Midterm Cards 2.0

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/107

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

108 Terms

1
New cards

What does IVT stand for?

Interrupt Vector Table

2
New cards

What is the motivation of IVT?

Create global functions that can be called from any segment

3
New cards

Where is IVT located in memory?

0×0000:0×0000 to 0×0000:0×03FF (first 1024 bytes of memory)

4
New cards

How many IVT entries are there?

256 entries (0×00 to 0xFF)

5
New cards

How many bytes per IVT entry?

4 bytes per entry

6
New cards

What does each 4-byte IVT entry contain?

Bytes 0-1: Offset (IP - instruction pointer)

Bytes 2-3: Segment (CS - code segment)

7
New cards

Formula to calculate IVT entry address for interrupt N?

Address = interrupt number x 4

8
New cards

is IVT used in modern protected mode systems?

No, only used in 16-bit real mode

9
New cards

What replaced IVT in protected mode?

IDT (Interrupt Descriptor Table)

10
New cards

Is IVT still used anywhere today?

Yes, during boot process in real mode before switching to protected mode

11
New cards

Why is CLI necessary before modifying IVT?

Disables interrupts

12
New cards

Why is SIT necessary after modifying IVT?

Re-enables interrupts

13
New cards

What are the critical steps to register an IVT handler?

  1. CLI (disable interrupts)

  2. Set ES to 0×0000

  3. Write offset to IVT entry

  4. Write segment to IVT entry

  5. STI (enable interrupts)

14
New cards

What instruction must end an interrupt handler?

IRET

15
New cards

Why can’t you use RET in an interrupt handler

RET only pops IP (and CS for far return)
IRET pops IP, CS, and FLAGS

16
New cards

What does IRET restore that RET doesn’t

FLAGS register

17
New cards

What are the 3 values IRET pops from stack?

IP

CS

FLAGS

18
New cards

What is the major secutiry flaw of real-mode IVT

No protection, any program can override any interrupt

19
New cards

How does protected mode (IDT) fix IVT security problem

IDT uses Ring levels (0-3). Only Ring 0 (kernel) can modify IDT. User programs (Ring 3) can’t access or modify interrupt handlers

20
New cards

What are Ring levels in protected mode?

Ring 0 = Kernel (highest privilege)

Ring 1-2 = Device drivers 

Ring 3 = User applications (lowest privilege)

21
New cards

Which Ring level can modify the IDT

Ring 0 (kernel mode) only

22
New cards

What is First-Fit allocation

Scan from beginning, allocate first hole large enough.

Fast but creates small holes at start of memory

23
New cards

What is Best-Fit allocation

Scan entire list, choose smallest hole that fits.

Minimizes wasted space but creates tiny unusable holes

24
New cards

What is Worst-Fit allocation

Choose largest available hole.

Leftover hole more likely usable but wastes large holes

25
New cards

External Fragmentation

Allocated block larger than needed, waste inside allocation

Ex: Need 1000 bytes, allocate 1024-byte block, 24 bytes wasted inside

26
New cards

Can FAT12 have external fragementation?

No, FAT12 uses chained allocation (not contiguous)

Files can be scattered across non-contiguous clusters

27
New cards

What is the identical concept: Sector (disk) vs ? (memory)

Page

28
New cards

Why does FAT use chained allocation instead of indexed

  1. Index section must be contiguous - same fragmentation problem as data

  2. Space constraints in FAT12

29
New cards

Why does memory use indexed (page tables) instead of chained

Time issue, memory needs fast random access

30
New cards

What are 2 problems of page allocation?

  1. Internal fragmentation 

  2. Grouped data (arrays) get scattered

31
New cards

Whats the advantage of segment over page

Only 2 numbers to describe: START address + LIMIT (size)

Segment is contiguous which is better for grouped data structures

32
New cards

Search Complexity: Linear search in page table

O(n)

33
New cards

Search Complexity: Binary search in page table

O(log n) but requires O(n log n) sort first

34
New cards

Search Complexity: Hash table in page table

O(1)

35
New cards

Which search method is typically used for page tables

Hash Table (O(1) lookup)

36
New cards

Can FAT12 have 525 files in root directory? Why?

No, root directory fixed at 224 entries maximum

37
New cards

Can FAT12 have 525 files total? Why?

Yes, by using subdirectories which have unlimited space

38
New cards

Can FAT12 have 525 subdirectories? Why?

Yes, subdirectories unlimited

39
New cards

How does FAT12 handle more than 224 files?

By using subdirectories

40
New cards

Is FAT12 purely chained allocation?

No, chained + indexed

41
New cards

Does FAT use best-fit allocation

No, uses chained allocation

42
New cards

Does FAT12 suffer from external fragmentation

No, doesn’t use contiguous allocation.

Files can be scattered

43
New cards

Was FAT created by Microsoft

No, purchased

44
New cards

Why are there 2 copies of FAT

Reliability

45
New cards

How many bits per FAT12 entry

12 bits

46
New cards

What’s the first valid FAT entry number

Entry 2 (entries 0 and 1 are reserved)

47
New cards

Can FAT entry values be negative

No, all FAT values are unsigned

48
New cards

What does FAT entry value 0×000 mean

Free cluster

49
New cards

What does FAT entry value 0xFFF mean

End of file marker

50
New cards

What’s the most influential OS overall

Unix

51
New cards

What OS is most influential for education

Minix

52
New cards

Is iOS Linux based

No (based on BSD/Darwin)

53
New cards

Is Android Linux based

Yes

54
New cards

3 main OS objectives

  1. Convenience

  2. Efficiency

  3. Ability to Evolve

55
New cards

Standard 1.44 MB floppy: Total sectors?

2880 sectors

56
New cards

Standard 1.44 MB floppy: Boot sector count?

1 sector

57
New cards

Standard 1.44 MB floppy: FAT sectors total

18 sectors (9 per FAT x 2 copies)

58
New cards

Standard 1.44 MB floppy: Root directory sectors

14 sectors

59
New cards

Standard 1.44 MB floppy: First data sector

33 (1 boot + 18 FAT + 14 root)

60
New cards

Standard 1.44 MB floppy: First valid cluster number

2 (clusters 0 and 1 reserved)

61
New cards

Boot sector bytes 11-12 contain what

Bytes per sector

62
New cards

Boot sector byte 13 contains what

Sectors per cluster

63
New cards

Boot sector bytes 14-15 contain what

Reserved sectors

64
New cards

Boot sector byte 16 contains what

Number of FAT copies

65
New cards

Boot sector bytes 17-18 contain what

Root directory entries

66
New cards

Boot sector bytes 19-20 contain what

Total sectors

67
New cards

Boot sector byte 21 contains what

Media descriptor

68
New cards

Boot sector bytes 22-23 contain what

Sectors per FAT

69
New cards
70
New cards
71
New cards
72
New cards

Formula to calculate byte offset for FAT entry N

byte offset = entry x 1.5

73
New cards

Formula to find which FAT sector contains entry N

FAT sector = byte offset / 512 (round up)

74
New cards

Formula to find position within FAT sector

position = byte offset mod 512

75
New cards

Formula to calculate row number in hex dump

row = position / 16

76
New cards

Formula to calculate column number in hex dump

col = position mod 16

77
New cards

Formula to convert cluster number to logical sector

logical sector = cluster + 31

78
New cards

Formula to calculate how many sectors a file occupies

sectors = file size / 512 (round up)

79
New cards

Formula to claculate first root directory logical sector

first root = 1 + (2 × sectors per FAT)

For standard floppy: 1 + (2 × 9) = 19

80
New cards

Formula to calculate first data sector (cluster 2)

First data = 1 + (2 x sectors per FAT) + root sectors

For standard floppy: 1 + 18 + 14 = 33

81
New cards

Formula to calculate root directory sectors needed

root sectors = (entries x 32) / 512

For 224 entries: (224 × 32) / 512 = 14

82
New cards

Formula to calculate IVT entry address for interrupt N

address = interrupt number x $

Result format: 0×0000:0×00XX

83
New cards

IVT total size formula

IVT size = 256 entries x 4 bytes = 1024 bytes = 1 KB

84
New cards

Formula to convert manufacturer GB to Windows GB

Windows GB = (Advertised x 1000³) / 1024³

85
New cards

Formula to convert Windows GB to manufacturer GB

Advertised GB = (Windows x 1024³) / 1000³

86
New cards

Formula for external fragmentation calculation

external fragmentation = sum of all remaining holes

Ex: [20,150,30,400] = 20+150+30+400 = 600 KB

87
New cards

What does VFAT stand for

Virtual FAT (extension for long filenames)

88
New cards

Maximum filename length in VFAT

255 characters

89
New cards

How to identify VFAT entry in hexdump

Byte 11 = 0×0F

90
New cards

In what order does VFAT store long filename parts

Reverse order (last part first, then middle, then start)

91
New cards

How many characters per VFAT pseudo-entry

13 Unicode characters per entry

92
New cards

Can DOS read VFAT long filenames

No, only sees 8.3 shortname 

93
New cards

If filename is “My Document.docx” (16 chars), how many VFAT entries needed

[16 / 13] = 2 VFAT entries

94
New cards

What comes after VFAT pseudo-entries

Actual 8.3 directory entry with file data (cluster, size, date, time)

95
New cards

Why does VFAT maintain 8.3 shortname

Backward compatibility with DOS/older systems

96
New cards

What’s stored in VFAT pseudo-entry checksum

Checksum of 8.3 shortname to verify entries belong together

97
New cards

How many bits per FAT16 entry

16 bits (2 bytes)

98
New cards

How many bits per FAT32 entry

32 bits (4 bytes), but only 28 bits actually used

99
New cards

Maximum clusters in FAT12

4096 clusters (2^12)

100
New cards

Maximum clusters in FAT16

65536 clusters (2^16)