摘要: 1 /* 2 * linux/kernel/system_call.s 3 * 4 * (C) 1991 Linus Torvalds 5 */ 6 7 /* 8 * system_call.s contains the system-call low-level handling routines. 9 * This also contains the timer-interrupt handler, as some of the code is 10 * the same. The hd- and flopppy-interrupts are ... 阅读全文
posted @ 2013-08-16 03:29 caesarxu 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 * linux/kernel/asm.s 3 * 4 * (C) 1991 Linus Torvalds 5 */ 6 7 /* 8 * asm.s contains the low-level code for most hardware faults. 9 * page_exception is handled by the mm, so that isn't here. This 10 * file also handles (hopefully) fpu-exceptions due to TS-bit, as 11 * the... 阅读全文
posted @ 2013-08-16 03:18 caesarxu 阅读(361) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 * linux/kernel/traps.c 3 * 4 * (C) 1991 Linus Torvalds 5 */ 6 7 /* 8 * 'Traps.c' handles hardware traps and faults after we have saved some 9 * state in 'asm.s'. Currently mostly a debugging-aid, will be extended 10 * to mainly kill the offending process (probably by givi... 阅读全文
posted @ 2013-08-16 03:16 caesarxu 阅读(687) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 * linux/kernel/sys.c 3 * 4 * (C) 1991 Linus Torvalds 5 */ 6 7 #include 8 9 #include 10 #include 11 #include 12 #include 13 #include 14 #include 15 16 int sys_ftime() 17 { 18 return -ENOSYS; 19 } 20 21 int sys_break() 22 { 23 return -ENOSYS; 24 } 25 ... 阅读全文
posted @ 2013-08-16 03:06 caesarxu 阅读(967) 评论(0) 推荐(0) 编辑
摘要: 00001 #define move_to_user_mode() \00002 __asm__ ("movl %%esp,%%eax\n\t" \00003 "pushl $0x17\n\t" \00004 "pushl %%eax\n\t" \00005 "pushfl\n\t" \00006 "pushl $0x0f\n\t" \00007 "pushl $1f\n\t" \00008 "iret\n" \//特权变换iret00009 " 阅读全文
posted @ 2013-08-13 05:51 caesarxu 阅读(625) 评论(0) 推荐(0) 编辑
摘要: 00053 union task_union {00054 struct task_struct task;00055 char stack[PAGE_SIZE];00056 };00057 00058 static union task_union init_task = {INIT_TASK,};//2013-08-13这里是否确定了???????????,任务0的堆栈空间,开始的内核后来的用户空间//2013-08-13 12:07:25这里确定的是任务o的,内核空间(当特权级从0->3后,任务0的内核态堆栈空间就在这)00059 00060 long volatile ... 阅读全文
posted @ 2013-08-13 05:39 caesarxu 阅读(478) 评论(0) 推荐(0) 编辑
摘要: 书囫囵吞枣读了几遍,返过头来,不明白的地方前边有提到.........PS.对比靓图会很有意思 以后看新内核代码也可以用这个方式 阅读全文
posted @ 2013-08-12 16:02 caesarxu 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 对学习书上的部分不懂,搜索到的,文章出处http://www.cnblogs.com/hongzg1982/articles/2120993.html#define _set_gate(gate_addr,type,dpl,addr)\__asm__("movw %%dx,%%ax\n\t"\ "movw %0,%%dx\n\t"\ "movl %%eax,%1\n\t"\ "movl %%edx,%2"\ :\ :"i"((short)(0x8000+(dpl<<13)+(type 阅读全文
posted @ 2013-08-11 17:50 caesarxu 阅读(1007) 评论(0) 推荐(0) 编辑