diff --git a/.idea/dragonOS.iml b/.idea/dragonOS.iml new file mode 100644 index 00000000..f08604bb --- /dev/null +++ b/.idea/dragonOS.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..79b3c948 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..7dcc9e44 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bochsrc b/bochsrc new file mode 100644 index 00000000..25759bb7 --- /dev/null +++ b/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 + diff --git a/bootloader/boot.asm b/bootloader/boot.asm index 97b55440..e54ec483 100644 --- a/bootloader/boot.asm +++ b/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 diff --git a/run_in_qemu.sh b/run_in_qemu.sh new file mode 100644 index 00000000..4dee2793 --- /dev/null +++ b/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 \ No newline at end of file