📄 krnl.lst
字号:
c000022b: 8a 45 08 mov 0x8(%ebp),%al
c000022e: 50 push %eax
c000022f: a1 f0 d3 00 c0 mov 0xc000d3f0,%eax
c0000234: 50 push %eax
c0000235: e8 46 0c 00 00 call c0000e80 <_putch>
main.c:65
return 0;
c000023a: 31 c0 xor %eax,%eax
c000023c: 89 ec mov %ebp,%esp
c000023e: 5d pop %ebp
c000023f: c3 ret
c0000240 <_kprintf>:
_kprintf():
main.c:73
}
/*****************************************************************************
*****************************************************************************/
void kprintf(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
c0000240: 55 push %ebp
c0000241: 89 e5 mov %esp,%ebp
c0000243: 83 ec 08 sub $0x8,%esp
c0000246: 8d 45 0c lea 0xc(%ebp),%eax
main.c:74
(void)do_printf(fmt, args, kprintf_help, NULL);
c0000249: 6a 00 push $0x0
c000024b: 68 20 02 00 c0 push $0xc0000220
c0000250: 50 push %eax
c0000251: 8b 45 08 mov 0x8(%ebp),%eax
c0000254: 50 push %eax
c0000255: e8 36 29 00 00 call c0002b90 <_do_printf>
c000025a: 89 ec mov %ebp,%esp
c000025c: 5d pop %ebp
c000025d: c3 ret
c000025e <.ef>:
main.c:76
va_end(args);
}
c000025e: 89 f6 mov %esi,%esi
c0000260 <_panic>:
_panic():
main.c:83
/*****************************************************************************
*****************************************************************************/
static void panic(const char *fmt, ...)
{
va_list args;
disable();
c0000260: 55 push %ebp
c0000261: 89 e5 mov %esp,%ebp
c0000263: 83 ec 08 sub $0x8,%esp
c0000266: e8 35 2d 00 00 call c0002fa0 <_disable>
main.c:84
va_start(args, fmt);
c000026b: 8d 45 0c lea 0xc(%ebp),%eax
main.c:85
(void)do_printf(fmt, args, kprintf_help, NULL);
c000026e: 6a 00 push $0x0
c0000270: 68 20 02 00 c0 push $0xc0000220
c0000275: 50 push %eax
c0000276: 8b 45 08 mov 0x8(%ebp),%eax
c0000279: 50 push %eax
c000027a: e8 11 29 00 00 call c0002b90 <_do_printf>
main.c:86
halt();
c000027f: e8 7c fd ff ff call c0000000 <_code>
c0000284: 89 ec mov %ebp,%esp
c0000286: 5d pop %ebp
c0000287: c3 ret
c0000288 <.ef>:
main.c:87
}
c0000288: 52 push %edx
c0000289: 44 inc %esp
c000028a: 53 push %ebx
c000028b: 4b dec %ebx
c000028c: 00 90 90 90 90 90 add %dl,0x90909090(%eax)
c0000292: 90 nop
c0000293: 90 nop
c0000294: 90 nop
c0000295: 90 nop
c0000296: 90 nop
c0000297: 90 nop
c0000298: 90 nop
c0000299: 90 nop
c000029a: 90 nop
c000029b: 90 nop
c000029c: 90 nop
c000029d: 90 nop
c000029e: 90 nop
c000029f: 90 nop
c00002a0: 69 6e 69 74 5f 74 61 imul $0x61745f74,0x69(%esi),%ebp
c00002a7: 73 6b jae c0000314 <_wake_up+0x30>
c00002a9: 73 3a jae c00002e5 <_wake_up+0x1>
c00002ab: 20 64 69 64 and %ah,0x64(%ecx,%ebp,2)
c00002af: 20 6e 6f and %ch,0x6f(%esi)
c00002b2: 74 20 je c00002d4 <.ef+0x4c>
c00002b4: 66 69 6e 64 20 52 imul $0x5220,0x64(%esi),%bp
c00002ba: 44 inc %esp
c00002bb: 53 push %ebx
c00002bc: 4b dec %ebx
c00002bd: 20 73 69 and %dh,0x69(%ebx)
c00002c0: 67 6e addr16 outsb %ds:(%si),(%dx)
c00002c2: 61 popa
c00002c3: 74 75 je c000033a <.bf+0x6>
c00002c5: 72 65 jb c000032c <_sleep_on+0x10>
c00002c7: 0a 00 or (%eax),%al
c00002c9: 6f outsl %ds:(%esi),(%dx)
c00002ca: 62 6a 20 bound %ebp,0x20(%edx)
c00002cd: 25 30 32 75 20 and $0x20753230,%eax
c00002d2: 2d 3e 20 74 61 sub $0x6174203e,%eax
c00002d7: 73 6b jae c0000344 <.bf+0x10>
c00002d9: 20 25 30 32 75 2c and %ah,0x2c753230
c00002df: 20 20 and %ah,(%eax)
c00002e1: 00 0a add %cl,(%edx)
...
c00002e4 <_wake_up>:
_wake_up():
main.c:131
/*****************************************************************************
*****************************************************************************/
DISCARDABLE_CODE(static int init_tasks(unsigned char *image))
{
unsigned char *rdsk_dir, *exec_file;
unsigned short num_objs, t, o;
task_t *task;
/* make sure it's a valid initial RAM disk */
if(memcmp(image, "RDSK", 4))
{
kprintf("init_tasks: did not find RDSK signature\n");
return -1;
}
/* the number of objects in the image is right after the signature */
num_objs = read_le32(image + 4);
t = 1;
for(o = 1; o < num_objs; o++)
{
/* don't run more tasks than we have virtual consoles */
if(t >= _num_vc)
break;
kprintf("obj %02u -> task %02u, ", o, t);
/* point to the 24-byte directory entry in the image for this task */
rdsk_dir = image + 8 + 24 * o;
/* get offset of object from directory of image; point to executable file */
exec_file = read_le32(rdsk_dir + 0) + image;
/* try loading as DJGPP COFF */
task = _tasks + t;
if(run(task, exec_file) != 0)
continue;
/* set other task stuff */
task->status = TS_RUNNABLE;
task->vc = _vc + t;
t++;
}
kprintf("\n");
/* return nonzero if no tasks were loaded */
return (t == 1) ? -1 : 0;
}
/*****************************************************************************
*****************************************************************************/
void wake_up(wait_queue_t *queue)
{
c00002e4: 55 push %ebp
c00002e5: 89 e5 mov %esp,%ebp
c00002e7: 8b 55 08 mov 0x8(%ebp),%edx
main.c:135
task_t *task, *next;
/* make sure queue is not empty */
task = queue->head;
c00002ea: 8b 02 mov (%edx),%eax
main.c:136
if(task == NULL)
c00002ec: 85 c0 test %eax,%eax
c00002ee: 74 27 je c0000317 <_wake_up+0x33>
main.c:139
return;
/* mark head task in queue runnable */
task->status = TS_RUNNABLE;
c00002f0: c7 40 14 01 00 00 00 movl $0x1,0x14(%eax)
main.c:141
/* remove head task from queue */
next = task->next;
c00002f7: 8b 40 20 mov 0x20(%eax),%eax
main.c:142
queue->head = next;
c00002fa: 89 02 mov %eax,(%edx)
main.c:143
if(next != NULL)
c00002fc: 85 c0 test %eax,%eax
c00002fe: 74 10 je c0000310 <_wake_up+0x2c>
main.c:144
next->prev = NULL;
c0000300: c7 40 24 00 00 00 00 movl $0x0,0x24(%eax)
c0000307: eb 0e jmp c0000317 <_wake_up+0x33>
c0000309: 8d b4 26 00 00 00 00 lea 0x0(%esi,1),%esi
main.c:146
else
queue->tail = NULL;
c0000310: c7 42 04 00 00 00 00 movl $0x0,0x4(%edx)
main.c:147
}
c0000317: 89 ec mov %ebp,%esp
c0000319: 5d pop %ebp
c000031a: c3 ret
c000031b <.ef>:
c000031b: 90 nop
c000031c <_sleep_on>:
_sleep_on():
main.c:151
/*****************************************************************************
*****************************************************************************/
int sleep_on(task_t *curr_task, wait_queue_t *queue, unsigned *timeout)
{
c000031c: 55 push %ebp
c000031d: 89 e5 mov %esp,%ebp
c000031f: 56 push %esi
c0000320: 53 push %ebx
main.c:152
int ret_val = 0;
c0000321: 31 f6 xor %esi,%esi
main.c:151
c0000323: 8b 55 08 mov 0x8(%ebp),%edx
c0000326: 8b 4d 0c mov 0xc(%ebp),%ecx
c0000329: 8b 5d 10 mov 0x10(%ebp),%ebx
main.c:156
task_t *prev;
/* mark task blocked */
curr_task->status = TS_BLOCKED;
c000032c: c7 42 14 02 00 00 00 movl $0x2,0x14(%edx)
c0000332 <.ef>:
c0000332: 00 8b 41 04 89 51 add %cl,0x51890441(%ebx)
c0000334 <.bf>:
main.c:158
/* splice into wait queue at queue->tail */
prev = queue->tail;
c0000334: 41 inc %ecx
c0000335: 04 89 add $0x89,%al
main.c:159
queue->tail = curr_task;
c0000337: 51 push %ecx
c0000338: 04 85 add $0x85,%al
main.c:160
if(prev == NULL)
c000033a: c0 (bad)
c000033b: 75 07 jne c0000344 <.bf+0x10>
main.c:162
{
queue->head = curr_task;
c000033d: 89 11 mov %edx,(%ecx)
main.c:163
curr_task->prev = NULL;
c000033f: 89 72 24 mov %esi,0x24(%edx)
main.c:164
}
c0000342: eb 06 jmp c000034a <.bf+0x16>
main.c:167
else
{
curr_task->prev = prev;
c0000344: 89 42 24 mov %eax,0x24(%edx)
main.c:168
prev->next = curr_task;
c0000347: 89 50 20 mov %edx,0x20(%eax)
main.c:170
}
curr_task->next = NULL;
c000034a: c7 42 20 00 00 00 00 movl $0x0,0x20(%edx)
main.c:172
/* set the timeout, if there is one */
if(timeout != NULL)
c0000351: 85 db test %ebx,%ebx
c0000353: 74 0b je c0000360 <.bf+0x2c>
main.c:173
curr_task->timeout = *timeout;
c0000355: 8b 03 mov (%ebx),%eax
c0000357: 89 42 1c mov %eax,0x1c(%edx)
c000035a: eb 0b jmp c0000367 <.bf+0x33>
c000035c: 8d 74 26 00 lea 0x0(%esi,1),%esi
main.c:175
else
curr_task->timeout = 0;
c0000360: c7 42 1c 00 00 00 00 movl $0x0,0x1c(%edx)
main.c:177
/* "fake" a timer interrupt. timer_irq() must detect this */
__asm__ __volatile__("int $0x20");
c0000367: cd 20 int $0x20
main.c:179
/* now: why did we return? */
if(timeout != NULL)
c0000369: 85 db test %ebx,%ebx
c000036b: 74 0e je c000037b <.bf+0x47>
main.c:181
{
*timeout = curr_task->timeout;
c000036d: 8b 42 1c mov 0x1c(%edx),%eax
c0000370: 89 03 mov %eax,(%ebx)
main.c:183
/* there was a timeout, so timer_irq() awoke us. Return -1 */
if(*timeout == 0)
c0000372: 85 c0 test %eax,%eax
c0000374: 75 05 jne c000037b <.bf+0x47>
main.c:184
ret_val = -1;
c0000376: be ff ff ff ff mov $0xffffffff,%esi
main.c:187
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -