浏览代码

evx: working on real machine :-)

rain 4 年之前
父节点
当前提交
ccb9d13099
共有 6 个文件被更改,包括 29 次插入 和 30 次删除
  1. 1 1
      Makefile
  2. 1 0
      arch/x86/boot/boot32.S
  3. 21 20
      arch/x86/boot/setup64.S
  4. 3 3
      arch/x86/include64/arch/archinfo.h
  5. 0 3
      arch/x86/kernel/arch_mm.c
  6. 3 3
      init/main.c

+ 1 - 1
Makefile

@@ -66,7 +66,7 @@ _all:
 	fi
 
 	@for d in $(obj-i); do 				\
-		$(MAKE) $(MAKEFLAGS) -C $$d D=$$d;	\
+		$(MAKE) -C $$d D=$$d $(MAKEFLAGS); 	\
 	done
 
 	@$(MAKE) -C $(ARCHDIR)/ vmevx.o

+ 1 - 0
arch/x86/boot/boot32.S

@@ -138,6 +138,7 @@ setup_e820:
 	movl %ebx, %es
 
 	movl $0, %edi
+	xorl %ebx, %ebx
 
 sel:	movl $0xe820, %eax
 	movl $20, %ecx

+ 21 - 20
arch/x86/boot/setup64.S

@@ -65,34 +65,35 @@ real_start:
 
 	/* setup paging (for long mode) */
 
-	movl $0, %edi
-	movl $512, %ecx
-	xorl %eax, %eax
+	/* finally I used the thing that I used, and this is better, I think.
+	 * initial 2m pages at 0 */
 
-	cld
+	movl $0x1007, 0
+	movl $0x0000, 4
 
-rsetpt:	rep
-	stosl
+	/* 0xffff800000000000 */
+	movl $0x1007, 0x800
+	movl $0, 0x804
 
-	movl $0x00001003, 0
-	movl $0x00001003, 0x800
+	movl $0x2007, 0x1000
+	movl $0, 0x1004
 
-	movl $0x00002003, 0x1000
-	movl $0x00003003, 0x2000
-	
-	movl $0x3000, %edi
-	movl $3, %eax
+	movl $0x000083, 0x2000
+	movl $0, 0x2004
+
+	movl $0x200083, 0x2008
+	movl $0, 0x200c
 
-rsetp:	movl %eax, (%edi)
-	movl $0, 4(%edi)
+	movl $0x400083, 0x2010
+	movl $0, 0x2014
 
-	addl $8, %edi
-	addl $4096, %eax
+	movl $0x600083, 0x2018
+	movl $0, 0x201c
 
-	cmpl $0x800000, %eax
-	jbe rsetp
+	movl $0x800083, 0x2020
+	movl $0, 0x2024
 
-	ljmp $0x08, $init_prot
+	ljmp $8, $init_prot
 
 
 .code32

+ 3 - 3
arch/x86/include64/arch/archinfo.h

@@ -29,9 +29,9 @@
 
 typedef __uint64_t __archptr_t;
 
-#define PAGE_SIZE 	4096lu
-#define PAGE_MASK 	4095lu
-#define PAGE_SHIFT 	12lu
+#define PAGE_SIZE 	2097152lu
+#define PAGE_MASK 	2097152lu
+#define PAGE_SHIFT 	21lu
 #define PAGE_ALIGN(a) 	(((a) + PAGE_MASK) & ~(PAGE_MASK))
 
 #define PAGE_NR(addr) 	((addr) >> PAGE_SHIFT)

+ 0 - 3
arch/x86/kernel/arch_mm.c

@@ -86,9 +86,6 @@ int arch_mm_init(void) {
 		}
 	}
 
-	cano_putc('O');
-
-
 	return 0;
 }
 

+ 3 - 3
init/main.c

@@ -33,9 +33,9 @@ extern int cano_putc(int);
 
 
 int __init init(void) {
-	cano_putc('A');
-
-	return do_init_calls();
+	do_init_calls();
+	
+	return 0;
 }