bootloader qx 4
Posted: Mon Sep 09, 2002 5:14 am
(This post is about my previous post.)
PlayOS; yes, LINEAR_SEL describes a segment with base address 0 and it is a readable segment. I noticed that this code worked on a 166 MHz machine and it is not working on my 800 MHz machine. I think the problem might be about BIOS settings of machines. Can base of text video memory addresses of two machines be different? Thanx in advance for any advices...
Previous Post:
The code below is a part of bootloader that I am trying to write. Here, code has turned into pmode. Now it should write Hello to upper left corner of screen but it does not. I could not find out why. Ant ideas are welcome. Thanx in advance for any advices...
NOTE: In case you might want to know, I started with org 0x0000 and A20 is (at leaset should be) enabled at this place of code.
...
mov cr0,eax
jmp SYS_CODE_SEL:do_pm + 0x7c00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 32-bit protected mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[BITS 32]
do_pm: mov ax,SYS_DATA_SEL
mov ds,ax ; not segments anymore: SELECTORS
mov ss,ax
nop
mov es,ax
mov fs,ax
mov ax,LINEAR_SEL
mov gs,ax
; write to text video memory starting at linear address 0xB8000
; (upper left corner of screen)
mov byte [gs:0xB8000],'H'
mov byte [gs:0xB8002],'e'
mov byte [gs:0xB8004],'l'
mov byte [gs:0xB8006],'l'
PlayOS; yes, LINEAR_SEL describes a segment with base address 0 and it is a readable segment. I noticed that this code worked on a 166 MHz machine and it is not working on my 800 MHz machine. I think the problem might be about BIOS settings of machines. Can base of text video memory addresses of two machines be different? Thanx in advance for any advices...
Previous Post:
The code below is a part of bootloader that I am trying to write. Here, code has turned into pmode. Now it should write Hello to upper left corner of screen but it does not. I could not find out why. Ant ideas are welcome. Thanx in advance for any advices...
NOTE: In case you might want to know, I started with org 0x0000 and A20 is (at leaset should be) enabled at this place of code.
...
mov cr0,eax
jmp SYS_CODE_SEL:do_pm + 0x7c00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 32-bit protected mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[BITS 32]
do_pm: mov ax,SYS_DATA_SEL
mov ds,ax ; not segments anymore: SELECTORS
mov ss,ax
nop
mov es,ax
mov fs,ax
mov ax,LINEAR_SEL
mov gs,ax
; write to text video memory starting at linear address 0xB8000
; (upper left corner of screen)
mov byte [gs:0xB8000],'H'
mov byte [gs:0xB8002],'e'
mov byte [gs:0xB8004],'l'
mov byte [gs:0xB8006],'l'