Tài liệu, luận văn, đồ án, tiểu luận, đề tài về Công Nghệ Thông Tin
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...
43 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 934 | Lượt tải: 0
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...
25 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 996 | Lượt tải: 0
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...
22 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 929 | Lượt tải: 0
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...
35 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 936 | Lượt tải: 0
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...
22 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 971 | Lượt tải: 0
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...
29 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 953 | Lượt tải: 0
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...
33 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 965 | Lượt tải: 0
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...
26 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 946 | Lượt tải: 0
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...
29 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 948 | Lượt tải: 0
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...
34 trang | Chia sẻ: candy98 | Ngày: 01/12/2020 | Lượt xem: 959 | Lượt tải: 0