]> Zhao Yanbai Git Server - kernel.git/commitdiff
delete binary file shell & hello
authorAceVest <zhaoyanbai@126.com>
Wed, 9 Jul 2014 16:01:29 +0000 (00:01 +0800)
committerAceVest <zhaoyanbai@126.com>
Wed, 9 Jul 2014 16:01:29 +0000 (00:01 +0800)
.gitignore
bin/hello [deleted file]
bin/shell [deleted file]
boot/multiboot.S
drivers/ide.c
kernel/setup.c
lib/libc.S

index 27fa5fc559ef25969a1132dcbe6b6af67326a5f1..bd1f8f418134dc15225e447c4e2d25720a5c6e3c 100644 (file)
@@ -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 (executable)
index 9df53d8..0000000
Binary files a/bin/hello and /dev/null differ
diff --git a/bin/shell b/bin/shell
deleted file mode 100755 (executable)
index 2be5a31..0000000
Binary files a/bin/shell and /dev/null differ
index 7b8feb3162da19163abf1a2ffeda31f38708dcf2..ab7e631d632a0834ea1a26f69ba351479d8dc285 100644 (file)
@@ -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
index 3d2f6ccb0642dbd0a4a9ffd7b179446f3f503e5c..2dee6256b601d629b63cefc2668196348ebde69e 100644 (file)
@@ -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);
 }
 
 
index afeef42a91252a488a277ce2f3039e4ecad10445..90d81dbe87dec4afa1766283e4956e82d54e7525 100644 (file)
@@ -54,8 +54,6 @@ const char *version =
     " by "
     BUIDER;
 
-int main() { } // for libc
-
 void setup_kernel()
 {
     extern char kernel_begin, kernel_end;
index 0d3c9af579458516156c47a8298ab60e029175f7..2bd52c163c6e2c1540f6d977fa3bc5de0c8c0227 100644 (file)
@@ -9,8 +9,15 @@ _start:
     nop
     nop
 
+    pushl   $0  # env
+    pushl   $0  # argv
+    pushl   $1  # argc
+
     call main
 
+
+    add $12, %esp
+
     nop
     nop
     nop