• 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: 934 | 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: 996 | 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: 929 | 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: 936 | 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: 971 | 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: 953 | 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: 965 | 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: 946 | Lượt tải: 0

  • Advanced Systems Programming - Lesson 5: The kernel’s task listAdvanced Systems Programming - Lesson 5: The kernel’s task list

    Multi-tasking • Modern operating systems allow multiple users to share a computer’s resources • Users are allowed to run multiple tasks • The OS kernel must protect each task from interference by other tasks, while allowing every task to take its turn using some of the processor’s available time Stacks and task-descriptors • To manage mult...

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

  • Advanced Systems Programming - Lesson 4: UNIX’s “grand illusion”Advanced Systems Programming - Lesson 4: UNIX’s “grand illusion”

    How Linux makes a hardware device appear to be a ‘file’Basic char-driver components Background • To appreciate the considerations that have motivated the over-all Linux driver’s design requires an understanding of how normal application-programs get their access to services that the operating system offers • This access is indirect – throug...

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