I/O
1
Disclaimer: some slides are adopted from book authors’ slides with permission
I/O Disclaimer: some slides are adopted from book authors slides - - PowerPoint PPT Presentation
I/O Disclaimer: some slides are adopted from book authors slides with permission 1 Recap Thrashing A processes is busy swapping pages in and out Memory-mapped I/O map a file on disk onto the memory space Copy-on-Write (COW)
1
Disclaimer: some slides are adopted from book authors’ slides with permission
2
3
2nd level
8 bits 8 bits
1st level
8 bits Virtual address format (24bits) Frame #
V
4 bits 3
Unused
1 Page table entry (8bit)
Addr +0 +1 +2 +3 +4 +5 +6 +7 +8 +A +B +C +D +E +F 0x000 31 0x010 0x020 41 .. 0x100 00 01 01 00 01 .. 0x200
Page-table base address = 0x100 Vaddr: 0x0703FE Paddr: 0x3FE Vaddr: 0x072370 Paddr: ??? Vaddr: 0x082370 Paddr: ???
4
2nd level
8 bits 8 bits
1st level
8 bits Virtual address format (24bits) Frame #
V
4 bits 3
Unused
1 Page table entry (8bit)
Addr +0 +1 +2 +3 +4 +5 +6 +7 +8 +A +B +C +D +E +F 0x000 31 0x010 0x020 41 .. 0x100 00 01 01 00 01 .. 0x200
Page-table base address = 0x100 Vaddr: 0x0703FE Paddr: 0x3FE Vaddr: 0x072370 Paddr: 0x470 Vaddr: 0x082370 Paddr: invalid
5
6
7
8
9
10
11
Samsung Exynos 4412 (ARM) Processor Address Map DRAM USB, SD/MMC, Timer, …
12
13
#define CTRL_BASE_ADDR 0xCE000000 int *io_base = (int *)ioremap_nocache(CRTL_BASE_ADDR, 4096); // initialize the device (by writing some values to h/w regs) *io_base = 0x1; *(io_base + 1) = 0x2; *(io_base + 2) = 0x3; … // wait until the device is ready (bit31 = 0) while (*io_base & 0x80000000); // send data to the device for (i = 0; i < sizeof(buffer); i++) { *(io_base + 0x10) = buffer[i]; while (*io_base & 0x80000000); }
Programmed I/O (PIO)
14
15
16
17
18
1956 IBM RAMDAC computer included the IBM Model 350 disk storage system 5M (7 bit) characters 50 x 24” platters Access time = < 1 second
19
20
Microcontroller Host I/F (SATA, …)
read, write
21
SCAN scheduling
22
Figure source: Micron, “TN-29-19: NAND Flash 101”, 2010
– SATA.
– S/W running on the controller – Provides disk abstraction
– ~1TB
– SATA (6Gbps) is the bottleneck – Some use PCIe I/F
23
Microcontroller NAND NAND NAND Host I/F (SATA, …)
read, write read, program, erase
24
25
System call Interface Virtual File System (VFS) Filesystem (FAT, ext4, …) Buffer cache Inode cache Directory cache I/O Scheduler User Applications