• Advanced Systems Programming - Lesson 15: Access to video memoryAdvanced Systems Programming - Lesson 15: Access to video memory

    How much VRAM is needed? • This depends on (1) the total number of pixels, and on (2) the number of bits-per-pixel • The total number of pixels is determined by the screen’s width and height (measured in pixels) • Example: when our “screen-resolution” is set to 1280-by-960, we are seeing 1,228,800 pixels • The number of bits-per-pixel (“colo...

    pdf32 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 1280 | Lượt tải: 0

  • Advanced Systems Programming - Lesson 14: Handling a UART interruptAdvanced Systems Programming - Lesson 14: Handling a UART interrupt

    The new ‘anchor’ cluster To reduce contention for CS workstations that have null-modem cables attached, we are bringing online an additional cluster of eight servers – you access them remotely LDD3: kernel 2.6.10 • Our text “Linux Device Drivers (3rd Ed)” is published by O’Reilly in February 2005 • The kernel version it covers is 2.6.10 ...

    pdf17 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 1334 | Lượt tải: 0

  • Advanced Systems Programming - Lesson 13: The UART projectAdvanced Systems Programming - Lesson 13: The UART project

    Tx and Rx • The UART has a transmission-engine, and also a reception-engine, which are able to operate simultaneously (i.e., “full-duplex”) • Software controls the UART’s operations by accessing several registers, using the x86 processor’s ‘in’ and ‘out’ instructions • Linux provides some convenient ‘macros’ that ‘hide’ the x86 machine-code...

    pdf43 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 1285 | Lượt tải: 0

  • Advanced Systems Programming - Lesson 12: Linux Memory IssuesAdvanced Systems Programming - Lesson 12: Linux Memory Issues

    Some Architecture History • 8080 (late-1970s) 16-bit address (64-KB) • 8086 (early-1980s) 20-bit address (1-MB) • 80286 (mid-’80s) 24-bit address (16-MB) • 80386 (late-’80s) 32-bit address (4-GB) • 80686 (late-’90s) 36-bit address (64-GB) • Core2 (mid-2000s) 40-bit address (1-TB) ‘Backward Compatibility’ • Many buyers resist ‘early obsolesc...

    pdf25 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 1381 | Lượt tải: 0

  • Advanced Systems Programming - Lesson 11: IA32 Paging SchemeAdvanced Systems Programming - Lesson 11: IA32 Paging Scheme

    What is ‘paging’? • It’s a scheme for dynamically remapping addresses for fixed-size memory-blocks What’s ‘paging’ good for? • For efficient ‘time-sharing’ among multiple tasks, an operating system needs to have several programs residing in main memory at the same time • To accomplish this using actual physical memory-addressing would requ...

    pdf22 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 1242 | Lượt tải: 0

  • Advanced Systems Programming - Lesson 10: Exceptions and InterruptsAdvanced Systems Programming - Lesson 10: Exceptions and Interrupts

    Rationale • Usefulness of a general-purpose computer is dependent on its ability to interact with various peripheral devices attached to it (e.g., keyboard, display, disk-drives, etc.) • Devices require a prompt response from the cpu when various events occur, even when the cpu is busy running a program • The x86 interrupt-mechanism provide...

    pdf35 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 1438 | Lượt tải: 0

  • Advanced Systems Programming - Lesson 9: Intel’s ‘cmpxchg’ instructionAdvanced Systems Programming - Lesson 9: Intel’s ‘cmpxchg’ instruction

    Intel’s documentation • You can find out what any of the Intel x86 instructions does by consulting the official software developer’s manual. • Our course-webpage has a link to this site that you can just click (under ‘Resources’) • The instruction-set reference is two parts: – Volume 2A: for opcodes A through M – Volume 2B: for opcodes N th...

    pdf22 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 1300 | Lượt tải: 0

  • Advanced Systems Programming - Lesson 8: A race-cure case studyAdvanced Systems Programming - Lesson 8: A race-cure case study

    Our recent ‘race’ example Our ‘cmosram.c’ device-driver included a ‘race condition’ in its ‘read()’ and ‘write()’ functions, since accessing any CMOS memory-location is a two-step operation, and thus is a ‘critical section’ in our code: outb( reg_id, 0x70 ); datum = inb( 0x71 ); Once the first step in this sequence is taken, the second ste...

    pdf29 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 1316 | Lượt tải: 0

  • Advanced Systems Programming - Lesson 7: Concurrent ProgrammingAdvanced Systems Programming - Lesson 7: Concurrent Programming

    Problems with ‘stash.c’ • We wrote a ‘public clipboard’ device-driver in order to illustrate ‘sleeping’ and ‘waking’ • But our initial version of that driver module exhibits some problems – for example, if we allow more one process to read from our ‘/dev/stash’ device-file concurrently: Reader in window #1: $ cat /dev/stash Reader in window...

    pdf33 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 1344 | Lượt tải: 0

  • Advanced Systems Programming - Lesson 6: A ‘ringbuffer’ applicationAdvanced Systems Programming - Lesson 6: A ‘ringbuffer’ application

    Devices might be ‘idle’ • With our previous device-driver examples (i.e., dram, cmosram), the data to be read was already there, just waiting to be input • But with certain other character devices, such as a keyboard, a program may want to input its data before any new data has actually been entered by a user • In such cases we prefer to wa...

    pdf26 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 1301 | Lượt tải: 0