06721 main() lock pick proc() restart() [2][4] MINIX minix2.0 GDT, IDT irq table[] CPU CPU CPU CPU (IDTR) idt[] CPU _hwint00:! Interrupt

Similar documents
1 CPU interrupt INT trap CPU exception

浙江大学本科论文模板

普 通 高 等 教 育 十 二 五 重 点 规 划 教 材 计 算 机 系 列 中 国 科 学 院 教 材 建 设 专 家 委 员 会 十 二 五 规 划 教 材 操 作 系 统 戴 仕 明 姚 昌 顺 主 编 姜 华 张 希 伟 副 主 编 郑 尚 志 梁 宝 华 参 编 参 编 周 进 钱 进

untitled

,768 32,767 32K JMP Jnnn (386+) LOOP CALL [Label:] JMP short/near/far address L10: jmp jmp L20: L10 L20

标题

<4D F736F F D20C7B6C8EBCABDCFB5CDB3C9E8BCC6CAA6B0B8C0FDB5BCD1A75FD1F9D5C22E646F63>

学习MSP430单片机推荐参考书


投影片 1


Microsoft PowerPoint - os_4.ppt

Microsoft Word - 专论综述1.doc

Microsoft Word - A doc

计 算 机 系 统 应 用 年 第 25 卷 第 1 期 的 编 程 语 言 Giotto [9] 编 写 控 制 程 序, 可 以 方 便 的 控 制 程 序 的 逻 辑 执 行 时 间, 从 而 使 得 任 务 时 间 的 依 赖 关 系

目 录

作 業 系 統 簡 介 光 有 電 腦 硬 體, 會 不 容 易 使 用 必 須 要 有 適 當 的 程 式, 才 方 便 操 作 硬 體 衍 生 作 業 系 統 需 求 : 提 供 方 便 使 用 者 執 行 程 式 平 台 有 效 使 用 各 種 電 腦 硬 體 資 源 Jingo C. Lia

2013 C 1 #include <stdio.h> 2 int main(void) 3 { 4 int cases, i; 5 long long a, b; 6 scanf("%d", &cases); 7 for (i = 0; i < cases; i++) 8 { 9 scanf("%

幻灯片 1



第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與

豐佳燕.PDF

378高雄市都市計畫說明書

大学计算机基础B.doc

穨2-08.doc

Microsoft Word - 32

1.第二卷第二期p1

Fig. 1 1 The sketch for forced lead shear damper mm 45 mm 4 mm 200 mm 25 mm 2 mm mm Table 2 The energy dissip

University of Science and Technology of China A dissertation for master s degree Research of e-learning style for public servants under the context of

Microsoft PowerPoint - lect01.ppt

实 践 探 讨 高 丽 : 从 少 数 民 族 大 学 生 的 阅 读 需 求 看 民 族 院 校 图 书 馆 的 资 源 建 设 有 区 域 性 和 民 族 性 很 强 的 传 统 学 科 特 色 学 科 及 优 势 学 科, 因 此 图 书 馆 的 资 源 建 设 也 要 顺 应 这 一 特 性

content

PowerPoint Presentation

A dissertation for Master s degree Metro Indoor Coverage Systems Analysis And Design Author s Name: Sheng Hailiang speciality: Supervisor:Prof.Li Hui,


标题

秘密

untitled


考 試 日 期 :2016/04/24 教 室 名 稱 :602 電 腦 教 室 考 試 時 間 :09: 二 技 企 管 一 胡 宗 兒 中 文 輸 入 四 技 企 四 甲 林 姿 瑄 中 文 輸 入 二 技 企 管 一

2011 餐 年 旅 教 育 創 新 發 展 學 術 研 討 會 論 文 集 To Discuss the Implementation Status of the 99 Vocational Hospitality Programme Group -By C School for Example

ROP_bamboofox.key

Construction of Chinese pediatric standard database A Dissertation Submitted for the Master s Degree Candidate:linan Adviser:Prof. Han Xinmin Nanjing

Abstract Since 1980 s, the Coca-Cola came into China and developed rapidly. From 1985 to now, the numbers of bottlers has increased from 3 to 23, and

Microsoft Word - CMRO ??????????????? Luxiaoyan

JOURNAL OF EARTHQUAKE ENGINEERING AND ENGINEERING VIBRATION Vol. 31 No. 6 Dec

Microsoft Word - 39.doc

1 TPIS TPIS 2 2

TwinCAT 1. TwinCAT TwinCAT PLC PLC IEC TwinCAT TwinCAT Masc

I

礼仪玉和葬玉

Theory of Groups is another course for undergraduates; and Module Theory will be a basic course of graduates). The main contents include the basic str

穨CY03519.PDF

CH01.indd

TI 3 TI TABLE 4 RANDBIN Research of Modern Basic Education

IP TCP/IP PC OS µclinux MPEG4 Blackfin DSP MPEG4 IP UDP Winsock I/O DirectShow Filter DirectShow MPEG4 µclinux TCP/IP IP COM, DirectShow I

Microsoft Word - 07.docx

Microsoft Word - ä¸fi颟æ−¥å‚−_å“ı弋论_1104

2013_6_3.indd


Microsoft Word - A _ doc

~m~li~* ~ ± ~ 1Jz. IDfU Y:.. a~~.~.oor.~~b~.~fi~~p A Study of Developing a Mobile APP for Supporting the Chinese Medicine Pulse Diagnosis Based on Pul

<4D F736F F D20B1D0B14DACE D303133A6A8AA47B3F8A76928A4FDAFC0AD7329>

南華大學數位論文

<4D F736F F D BFECBEC7BBA1A9FAB77C5FB57BA7C7AAEDA4CEA5D8BFFD>

广 州 市 花 都 区 公 务 员 培 训 需 求 分 析 的 研 究 A STUDY OF TRAINING NEEDS ANALYSIS ON CIVIL SERVANTS OF HUADU DISTRICT IN GUANGZHOU 作 者 姓 名 : 黄 宁 宁 领 域 ( 方 向 ): 公

1 目 錄 1. 簡 介 一 般 甄 試 程 序 第 一 階 段 的 準 備 第 二 階 段 的 準 備 每 間 學 校 的 面 試 方 式 各 程 序 我 的 做 法 心 得 及 筆 記 結 論..

面 对 井 喷 式 的 市 场 需 求, 全 球 范 围 内 掀 起 了 一 股 无 人 机 的 产 业 发 展 热 潮, 调 查 显 示, 仅 在 美 国 就 有 超 过 50 多 家 大 学 公 司 和 政 府 机 构 正 在 开 发 150 余 种 不 同 类 型 的 无 人 机 在 我 国,

壹:教育文化公益慈善機關或團體免納所得稅適用標準

untitled

instructions.PDF


2

Shanghai International Studies University A STUDY ON SYNERGY BUYING PRACTICE IN ABC COMPANY A Thesis Submitted to the Graduate School and MBA Center I

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;

Microsoft PowerPoint ARIS_Platform_en.ppt

Oates U

2) 膨 胀 剂 : 采 用 52.5 高 铝 水 泥 + 天 然 二 水 石 膏 制 成 3) 砂 : 采 用 目 水 洗 砂 4) 活 性 矿 物 : 采 用 比 表 面 积 为 cm 2 /g 左 右 的 硅 灰 5) 胶 粉 : 宝 辰 化 学 7042W 防 水

Transcription:

MINIX ( 730000) ( 730000) MINIX MINIX2.0 MINIX : MINIX TP3 1 MINIX UNIX Tanenbaum UNIX MINIX LINUX MINIX MINIX MINIX1.0 UNIX V7 MINIX2.0[3] POSIX MINIX3 MINIX Gabriel A. Wainer 1994-1995 [5] 1998 I/O 2002 RT-MINIXv2 [6] MINIX2.0 MINIX2.0 MINIX MINIX MINIX 2 MINIX MINIX2.0 int nnn nnn 1983- E-mail:gongwb@yahoo.cn 1

06721 main() lock pick proc() restart() [2][4] MINIX2.0 2.1 minix2.0 GDT, IDT irq table[] CPU CPU CPU CPU (IDTR) idt[] CPU 06164 _hwint00:! Interrupt routine for irq 0 (the clock). 06165 hwint_master(0) src/kernel/mpx386.s hwint00 06140 06160 CPU CPU CPU idt[] CPU idt[] 07785 gate table[] 07873 for idt[] call save CPU 06160 restart save src/kernel/mpx386.s 06254 06262-06267 CPU minix CPU CPU ss esp proc[nr TASKS + NR PROCS] ss esp struct stackframe s p reg 04583 struct stackframe s... CPU idt[] hwint master hwint slave call save 06274 esp 06486 k stktop: 06267 push CPU stackframe s p reg 06268-06271 ds es MINIX k reenter 2

hwint slave() hwint master() call ( irq table + 4*irq) k reenter ( -1 06338 ) push restart hwint slave() hwint master() restart1 CPU restart1 jmp hwint slave() hwint master() push restart1 restart pop hwint master() hwint slave() 06152 call irq table[] ret restart restart1 CPU 06322 restart 06337 restart1 restart src/kernel/mpx386.s 06322 06329-06331 held head held tail unhold() interrupt() 06333 stackframe s p reg stackframe s I/O k reenter pop CPU proc ptr esp 4 iretd 2.2 int n (include/minix/type.h) proc[nr TASKS + NR PROCS] p nr CPU int SYS386 VECTOR idt[] SYS386 VECTOR 07765 prot init() 07882 int_gate(sys386_vector, (phys_bytes) (vir_bytes) s_call, 07883 PRESENT (USER_PRIVILEGE << DPL_SHIFT) INT_GATE_TYPE); s call int gate() idt[] int gate() idt[] CPU s call 06288 s call: 06306 save CPU call sys call push C sys call() C 06315 restart: proc ptr 3

2.3 07785 gate table[] 07786-07801 06348!* exception handlers 06350 06412 CPU idt[] 06350 06412 06350 _divide_error: 06351 push DIVIDE_VECTOR 06352 jmp exception exception: errexception: 06420 exception C exception() CPU restart ret C exception() panic() wreboot() MINIX2.0 C exception() call save restart: ret restart: 3 MINIX 3.1 MINIX Table 1 MINIX MINIX MINIX I/0 I/0 I/0 I/0 MINE MINIX MINIX MINIX Table 2 Table 3 MINIX Table 2 xtint() xtsave xtstart 4

I/O Table 1: init (mm) (fs) (nets) I/O Table 2: MINIX 1 init (mm) (fs) (nets) I/O Table 3: MINIX 2 init (mm) (fs) (nets) NR TASKS include/minix/config.h 02680 #define ENABLE_XT_TASKS 1 include/minix/const.h 02953 NR TASKS #define NR_TASKS (9 + ENABLE_WINI + ENABLE_SCSI + ENABLE_CDROM \ + ENABLE_NETWORKING + 2 * ENABLE_AUDIO+ENABLE_XT_TASKS) src/kernel/proc.h EXTERN struct proc *xtproc = proc[nr_tasks]; xtproc src/kernel/mpx386.s xtint() xtsave xtstart Table 4 xtint() src/kernel/mpx386.s 06188 06189 _hwint06: xtint()! Interrupt routine for irq 6 (RT_Task) CPU xtint() 5

Table 4: define xtint() \ xtsave: xtstart: cli cld mov esp, xtproc call xtsave pushad lldt P LDT SEL(esp) ret o16 push ds lea eax, P STACKTOP(esp) o16 push es o16 push fs o16 push gs mov dx, ss mov ds, dx mov es, dx mov ( tss+tss3 S SP0), eax o16 pop gs o16 pop fs o16 pop es o16 pop ds popad mov eax, esp add esp, 4 mov esp, k stktop push xtstart xor ebp, ebp jmp RETADR-P STACKBASE(eax) iretd xt task() src/kernel/ include/minix/com.h 03516 #define XT (TTY - ENABLE_XT_TASKS) src/kernel/table.c 05676 #define XT_STACK SMALL_STACK src/kernel/table.c main() 05699 tasktab[] tty task #if ENABLE_XT_TASKS { xt_task, XT_STACK, "XT" }, #endif makefile 3.2 1. PC MINIX2.0 MINIX 2. MINIX2.0 MINIX2.0 MINIX MINIX 6

MINIX indows Vmware Workstation Linux Bochs[1] 4 MINIX MINIX MINIX MINIX MINIX2.0 [1] Linux 0.11 V2.0 www.oldlinux.org [2] 80386 [3] ( )Tanenbaum,Andrew S. ( )Woodhull,Albert S. [4] 80X86 [5] Gabriel A. Wainer, Implementing Real-Time services in MINIX, ACM Operating Systems Review, July 1995. [6] Pessolani, Pablo A, RT-MINIXv2: Architecture and Interrupt Handling, 33th JAIIO, Argentine Symposium on Computing Technology (AST2004), 2004. MINIX Operating System s Interrupt Mechanism Analysis And Real-time Extensions Gong Weibing Zhu Wenjun (School of Mathematics and Statistics, Lanzhou University, Lanzhou, 730000, China) (School of Mathematics and Statistics, Lanzhou University, Lanzhou, 730000, China) Abstract: MINIX is a teaching-oriented operating system.it is the first completely free source code provided for public.due to this strong point,it is very convenient to study OS for us.and we can also understand OS s fundamental principle more profoundly through studying the source code.it s layered structure is very simple and basic for an OS.We will analyze the source code to interpret MINIX2.0 OS s interrupt mechanism,including hardware interrupt,soft interrupt and exception.and we will also supply the method extended a real-time task. Keywords: MINIX OS Interrupt Mechanism Hardware Interrupt Soft Interrupt Exception Realtime Extensions Real-time Task 7