浏览代码

:new: qemu启动脚本

fslongjin 3 年之前
父节点
当前提交
d666fbdd15
共有 7 个文件被更改,包括 78 次插入3 次删除
  1. 2 0
      .idea/dragonOS.iml
  2. 4 0
      .idea/misc.xml
  3. 8 0
      .idea/modules.xml
  4. 6 0
      .idea/vcs.xml
  5. 53 0
      bochsrc
  6. 2 3
      bootloader/boot.asm
  7. 3 0
      run_in_qemu.sh

+ 2 - 0
.idea/dragonOS.iml

@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module classpath="CMake" type="CPP_MODULE" version="4" />

+ 4 - 0
.idea/misc.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
+</project>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/dragonOS.iml" filepath="$PROJECT_DIR$/.idea/dragonOS.iml" />
+    </modules>
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 53 - 0
bochsrc

@@ -0,0 +1,53 @@
+# configuration file generated by Bochs
+plugin_ctrl: unmapped=1, biosdev=1, speaker=1, extfpuirq=1, parallel=1, serial=1, iodebug=1
+config_interface: textconfig
+display_library: sdl
+#memory: host=2048, guest=2048
+romimage: file="/usr/local/share/bochs/BIOS-bochs-latest"
+vgaromimage: file="/usr/local/share/bochs/VGABIOS-lgpl-latest"
+boot: floppy
+floppy_bootsig_check: disabled=0
+floppya: type=1_44, 1_44="./bin/boot.img", status=inserted, write_protected=0
+# no floppyb
+ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
+ata0-master: type=none
+ata0-slave: type=none
+ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
+ata1-master: type=none
+ata1-slave: type=none
+ata2: enabled=0
+ata3: enabled=0
+pci: enabled=1, chipset=i440fx
+vga: extension=vbe, update_freq=5
+
+cpu: count=1:1:1, ips=4000000, quantum=16, model=corei7_haswell_4770, reset_on_triple_fault=1, cpuid_limit_winnt=0, ignore_bad_msrs=1, mwait_is_nop=0, msrs="msrs.def"
+
+cpuid: x86_64=1,level=6, mmx=1, sep=1, simd=avx512, aes=1, movbe=1, xsave=1,apic=x2apic,sha=1,movbe=1,adx=1,xsaveopt=1,avx_f16c=1,avx_fma=1,bmi=bmi2,1g_pages=1,pcid=1,fsgsbase=1,smep=1,smap=1,mwait=1,vmx=1
+cpuid: family=6, model=0x1a, stepping=5, vendor_string="GenuineIntel", brand_string="Intel(R) Core(TM) i7-4770 CPU (Haswell)"
+
+print_timestamps: enabled=0
+debugger_log: -
+magic_break: enabled=0
+port_e9_hack: enabled=0
+private_colormap: enabled=0
+clock: sync=none, time0=local, rtc_sync=0
+# no cmosimage
+# no loader
+log: -
+logprefix: %t%e%d
+debug: action=ignore
+info: action=report
+error: action=report
+panic: action=ask
+keyboard: type=mf, serial_delay=250, paste_delay=100000, user_shortcut=none
+mouse: type=ps2, enabled=0, toggle=ctrl+mbutton
+speaker: enabled=1, mode=system
+parport1: enabled=1, file=none
+parport2: enabled=0
+com1: enabled=1, mode=null
+com2: enabled=0
+com3: enabled=0
+com4: enabled=0
+
+megs: 2048
+

+ 2 - 3
bootloader/boot.asm

@@ -28,9 +28,8 @@ Label_Start:
     mov ax, 0x1301 ;设置显示字符串,显示后,光标移到字符串末端
     mov bx, 0x000f ;设置黑色背景,白色字体,高亮度,不闪烁
     mov dx, 0x0000 ;设置游标行列号均为0
-    mov cx, 10 ;设置字符串长度为10
+    mov cx, 20 ;设置字符串长度为20
 
-            ;为什么这里不能直接把ds赋值给es?
     push ax
     mov ax, ds
     mov es, ax
@@ -45,7 +44,7 @@ Label_Start:
 
     jmp $
 
-StartBootMessage:   db  "Start Boot"
+StartBootMessage:   db  "[DragonOS]Start Boot"
 
 ;填满整个扇区的512字节
     times 510 - ( $ - $$ ) db 0

+ 3 - 0
run_in_qemu.sh

@@ -0,0 +1,3 @@
+# 将引导程序写入boot.img
+dd if=bin/boot.bin of=bin/boot.img bs=512 count=1 conv=notrunc
+qemu-system-x86_64 -s -S -m 2048 -fda bin/boot.img