From: AceVest Date: Wed, 9 Jul 2014 16:01:29 +0000 (+0800) Subject: delete binary file shell & hello X-Git-Tag: 0.3.0~26 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=23646e23e5bbd6f882ecd11b657d3b367a06a88e;p=kernel.git delete binary file shell & hello --- diff --git a/.gitignore b/.gitignore index 27fa5fc..bd1f8f4 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,6 @@ *.map *.diff *.swp -bin/hw -bin/sh +bin/hello +bin/shell a.* diff --git a/bin/hello b/bin/hello deleted file mode 100755 index 9df53d8..0000000 Binary files a/bin/hello and /dev/null differ diff --git a/bin/shell b/bin/shell deleted file mode 100755 index 2be5a31..0000000 Binary files a/bin/shell and /dev/null differ diff --git a/boot/multiboot.S b/boot/multiboot.S index 7b8feb3..ab7e631 100644 --- a/boot/multiboot.S +++ b/boot/multiboot.S @@ -18,6 +18,7 @@ #include "system.h" #include "task.h" .global kernel_entry +.global main .extern check_kernel .extern setup_kernel .extern init_pgd @@ -42,6 +43,7 @@ .code32 .align 32 kernel_entry: +main: # Reset EFLAGS pushl $0 popf diff --git a/drivers/ide.c b/drivers/ide.c index 3d2f6cc..2dee625 100644 --- a/drivers/ide.c +++ b/drivers/ide.c @@ -202,15 +202,17 @@ void ide_status() void ide_debug() { - u32 device; - u32 nsect = 1; - u32 retires = 100; - u64 sect_nr = 0; - int count=SECT_SIZE; + unsigned int nsect = 1; + char *buf = kmalloc(1*SECT_SIZE, 0); + if(buf == 0) + panic("out of memory"); + + ide_do_read(0, nsect, buf); - nsect = (count + SECT_SIZE -1)/SECT_SIZE; + u16_t sig = *((u16_t *) (buf+510)); + printk("%s SIG: %04x\n", __func__, sig); - ide_cmd_out(0, nsect, sect_nr, HD_CMD_READ_EXT); + kfree(buf); } diff --git a/kernel/setup.c b/kernel/setup.c index afeef42..90d81db 100644 --- a/kernel/setup.c +++ b/kernel/setup.c @@ -54,8 +54,6 @@ const char *version = " by " BUIDER; -int main() { } // for libc - void setup_kernel() { extern char kernel_begin, kernel_end; diff --git a/lib/libc.S b/lib/libc.S index 0d3c9af..2bd52c1 100644 --- a/lib/libc.S +++ b/lib/libc.S @@ -9,8 +9,15 @@ _start: nop nop + pushl $0 # env + pushl $0 # argv + pushl $1 # argc + call main + + add $12, %esp + nop nop nop