4 ms·
Not important, I just thought it'd be fun to write but: > Hello world in real mode is leveraging a bunch of code and data from the BIOS Not necessarily, you c
by messe 8y ago
Not important, I just thought it'd be fun to write but:
> Hello world in real mode is leveraging a bunch of code and data from the BIOS
Not necessarily, you can avoid the BIOS calls by just copying the string directly to video memory:
mov ax, 0xB800
mov es, ax
xor di, di
mov ah, 0x07
mov si, hello
;; Load character, if zero, jump to end otherwise store
;; character and color in video memory
@@: lodsb
test al, al
jz @f
stosw
jmp @b
;; Halt and wait for interrupt
@@: hlt
jmp @b
hello: db 'Hello, World!', 00h
That's a total of 37 byes including the string.
- gecko 8y agoI might be missing something, but you're still relying on the BIOS to have the graphical representation of those letters. Right?
- messe 8y agoAs far as I remember, the default VGA font is stored on the graphics card ROM and copied into the video memory by that same onboard ROM, not the motherboard BIOS, so no I don't believe so. I may be mistaken.