OSDN Git Service

(none)
authorryuz <ryuz>
Sat, 5 Jan 2008 06:11:12 +0000 (06:11 +0000)
committerryuz <ryuz>
Sat, 5 Jan 2008 06:11:12 +0000 (06:11 +0000)
sample/ia32/pcat/gcc/gmake.mak
sample/ia32/pcat/gcc/switch32.S

index 80944d4..d14c478 100755 (executable)
@@ -127,6 +127,11 @@ ipl.bin: $(OBJS_DIR)/ipl.o
        $(CMD_OBJCNV) -O binary ipl.out ipl.bin
 
 
+.PHONY : bochs
+bochs: $(TARGET).img
+       bochs "floppya: 1_44=$(TARGET).img, status=inserted" "boot: a"
+
+
 # --------------------------------------
 #  %jp{依存関係}
 # --------------------------------------
index 6826170..457439d 100755 (executable)
@@ -8,12 +8,11 @@
  */
 
 
+LOAD_ADDR = 0x90000
 
 
                                .code16
                                .text
-                               .align  4
-
 
                                .global         _switch32
 
@@ -28,21 +27,23 @@ _switch32:
                                movw    $boot_message, %si
                                call    bios_puts
                                
-_switch32_end:
-                               hlt
-                               jmp                     _switch32_end
-                               
+                               /* GDT設定 */
                                lgdt    gdtr
-                               lidt    idtr
                                
-                               movl    $0x11, %eax
+                               /* プロテクトモードへ移行 */
+                               movl    %cr0, %eax
+                               orl             $0x00000001, %eax
                                movl    %eax, %cr0
-                               jmp             _go_32bit_mode
                                
-_go_32bit_mode:
+                               /* パイプラインフラッシュ */
+                               jmp             _pipeline_flush
+_pipeline_flush:
+                               
+                               
+                               /* CS設定 */
                                .byte   0x66, 0xea
-                               .long   _start_32bit + 0x90000
-                               .word   0x0001
+                               .long   _start_32bit + LOAD_ADDR
+                               .word   0x0008
 
                                .code32
 _start_32bit:
@@ -121,7 +122,7 @@ gdt_end:
 
                                /* lgdt命令用領域 */
 gdtr:                  .word   gdt_end - gdt_base - 1
-                               .long   0
+                               .long   gdt_base + LOAD_ADDR