Repos / kernel.git / commitdiff
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6558f0f)
raw | patch | inline | side by side (parent: 6558f0f)
| author | zhaoyanbai <zhaoyanbai@126.com> | |
| Wed, 9 Jul 2014 16:01:29 +0000 (00:01 +0800) | ||
| committer | zhaoyanbai <zhaoyanbai@126.com> | |
| Wed, 3 Nov 2021 02:45:37 +0000 (10:45 +0800) |
| .gitignore | patch | blob | history | |
| bin/hello | [deleted file] | patch | blob | history |
| bin/shell | [deleted file] | patch | blob | history |
| boot/multiboot.S | patch | blob | history | |
| drivers/ide.c | patch | blob | history | |
| kernel/setup.c | patch | blob | history | |
| lib/libc.S | patch | blob | history |
diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
*.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
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 2be5a31..0000000
Binary files a/bin/shell and /dev/null differ
diff --git a/boot/multiboot.S b/boot/multiboot.S
--- a/boot/multiboot.S
+++ b/boot/multiboot.S
#include "system.h"
#include "task.h"
.global kernel_entry
+.global main
.extern check_kernel
.extern setup_kernel
.extern init_pgd
.code32
.align 32
kernel_entry:
+main:
# Reset EFLAGS
pushl $0
popf
diff --git a/drivers/ide.c b/drivers/ide.c
--- a/drivers/ide.c
+++ b/drivers/ide.c
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
--- a/kernel/setup.c
+++ b/kernel/setup.c
" 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
--- a/lib/libc.S
+++ b/lib/libc.S
nop
nop
+ pushl $0 # env
+ pushl $0 # argv
+ pushl $1 # argc
+
call main
+
+ add $12, %esp
+
nop
nop
nop