3
« am: 17. April 2012, 02:23 »
Hey,
Ich arbeite grade an einem Kernel. Nun wollte ich mit Bochs anschauen ob alles funzt, aber er sagt mir dauernd das er nicht vom Floppy booten kann.
bochs_src:
# configuration file generated by Bochs
plugin_ctrl: unmapped=1, biosdev=1, speaker=1, extfpuirq=1, gameport=1
config_interface: win32config
display_library: win32
memory: host=32, guest=32
romimage: file="C:\Program Files (x86)\Bochs-2.5.1/BIOS-bochs-latest"
vgaromimage: file="C:\Program Files (x86)\Bochs-2.5.1/VGABIOS-lgpl-latest"
boot: floppy
floppy_bootsig_check: disabled=0
floppya: type=1_44, 1_44="C:\Users\Wehmeyer\Documents\KW-OS\kernel.bin", status=inserted, write_protected=0
# no floppyb
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
ata2: enabled=0
ata3: enabled=0
parport1: enabled=1, file="parport.out"
parport2: enabled=0
com1: enabled=1, mode=null, dev=""
com2: enabled=0
com3: enabled=0
com4: enabled=0
usb_uhci: enabled=0
usb_ohci: enabled=0
usb_xhci: enabled=0
pci: enabled=0
vga: extension=vbe, update_freq=3
cpu: count=1, ips=10000000, model=bx_generic, reset_on_triple_fault=1, cpuid_limit_winnt=0, ignore_bad_msrs=1
cpuid: family=6, model=0x03, stepping=3, mmx=1, apic=xapic, sse=sse2, sse4a=0, sep=1, aes=0, xsave=0, xsaveopt=0, movbe=0, smep=0, x86_64=1, 1g_pages=0, pcid=0, fsgsbase=0, mwait=1, mwait_is_nop=0
cpuid: vendor_string="GenuineIntel"
cpuid: brand_string=" Intel(R) Pentium(R) 4 CPU "
print_timestamps: enabled=0
port_e9_hack: enabled=0
private_colormap: enabled=0
clock: sync=none, time0=local
# no cmosimage
ne2k: enabled=0
pnic: enabled=0
sb16: enabled=0
es1370: enabled=0
# no loader
log: bochsout.txt
logprefix: %t%e%d
panic: action=ask
error: action=report
info: action=report
debug: action=ignore
keyboard_type: mf
keyboard_serial_delay: 250
keyboard_paste_delay: 100000
keyboard_mapping: enabled=0, map=
user_shortcut: keys=none
mouse: enabled=0, type=ps2, toggle=ctrl+mbutton
kernel.asm:
mov ax, 0x07C0
mov ds, ax
mov es, ax
mov si, welcome
call print_string
loop:
mov si, prompt
call print_string
mov di, buffer
call get_string
mov si, buffer
cmp byte [si], 0
je loop
mov si, buffer
mov di, cmd_help
call strcmp
jc .help
mov si,badcommand
call print_string
jmp loop
.help:
mov si, msg_help
call print_string
jmp loop
welcome db 'Herzlich Willkommen bei KW - OS!', 0x0D, 0x0A, 0
badcommand db 'Bad command entered.', 0x0D, 0x0A, 0
prompt db '>', 0
cmd_help db 'help', 0
msg_help db 'Commands: help', 0x0D, 0x0A, 0
buffer times 64 db 0
print_string:
lodsb
or al, al
jz .done
mov ah, 0x0E
int 0x10
jmp print_string
.done:
ret
get_string:
xor cl, cl
.loop:
mov ah, 0
int 0x16
cmp al, 0x08
je .backspace
cmp al, 0x0D
je .done
cmp cl, 0x3F
je .loop
mov ah, 0x0E
int 0x10
stosb
inc cl
jmp .loop
.backspace:
cmp cl, 0
je .loop
dec di
mov byte [di], 0
dec cl
mov ah, 0x0E
mov al, 0x08
int 10h
mov al, ' '
int 10h
mov al, 0x08
int 10h
jmp .loop
.done:
mov al, 0
stosb
mov ah, 0x0E
mov al, 0x0D
int 0x10
mov al, 0x0A
int 0x10
ret
strcmp:
.loop:
mov al, [si]
mov bl, [di]
cmp al, bl
jne .notequal
cmp al, 0
je .done
inc di
inc si
jmp .loop
.notequal:
clc
ret
.done:
stc
ret
times 510-($-$$) db 0
db 0x55
db 0xAA
Ich hoffe mal das ihr helfen könnt.
Mit freundlichen grüßen,
K. Wehmeyer