OSdev
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:OSdev
you're assuming that CS will be 0 instead of enforcing it. If your kernel is indeed loaded at 0x8000, just do
and it'll be fine.
As for protected mode setup, i suggest you get a look at BonaFide and OSRC tutorials, as suggested in the FAQ and .:QuickLinkz:.
Code: Select all
jmp 0000:0x8000
As for protected mode setup, i suggest you get a look at BonaFide and OSRC tutorials, as suggested in the FAQ and .:QuickLinkz:.
Re:OSdev
Please tell me your nick has some SF background and wasn't meant as offense.
Every good solution is obvious once you've found it.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:OSdev
Can you be more specific ? (e.g. post the error code/msg you get in the "working on the FAQ" thread ...)Solar_worm wrote: MegaTokyo FAQ doesn't work.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:OSdev
haven't toyed with msdebug for ages. i guess it should have some help somewhere (try out "help debug" or "h" in debug)
people around here use tools like rawrite or winimage for floppy management ...
people around here use tools like rawrite or winimage for floppy management ...
Re:OSdev
This is the smalist code for geting into pmode.
Assemble with fasm.
PS: The space in the text, must be the same as above.
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
Code: Select all
;************************************
; \\|//
; (@ @)
; ASHLEY4.
; Put test.bin on boot sector
; with rawrite.
; Assemble with fasm
; c:\fasm test.asm test.bin
;************************************
org 0x7C00
use16
;****************************
; Realmode startup code.
;****************************
start:
xor ax,ax
mov ds,ax
mov es,ax
mov ss,ax
mov sp,0x7C00
;*****************************
; Setting up, to enter pmode.
;*****************************
cli
lgdt [gdtr]
mov eax, cr0
or al,0x1
mov cr0,eax
jmp 0x10: protected
;*****************************
; Pmode. ;-)
;*****************************
use32
protected:
mov ax,0x8
mov ds,ax
mov es,ax
mov ss,ax
mov esp,0x7C00
;*****************************
; Turn floppy off (if space).
;*****************************
mov dx,3F2h
mov al,0
out dx,al
lea esi,[msg0]
mov edi,0xB8000 + (80 * 3 + 4) * 2
mov ecx,28
cld
rep movsb
jmp $
;*************************************
; GDT.
;*************************************
gdt: dw 0x0000, 0x0000, 0x0000, 0x0000
sys_data: dw 0xFFFF, 0x0000, 0x9200, 0x00CF
sys_code: dw 0xFFFF, 0x0000, 0x9800, 0x00CF
gdt_end:
gdtr: dw gdt_end - gdt - 1
dd gdt
;*************************************
; Data.
;*************************************
msg0 db " H E L L O W O R L D ! "
;*************************************
; Make program 510 byte's + 0xaa55
;*************************************
times 510- ($-start) db 0
dw 0xaa55
PS: The space in the text, must be the same as above.
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
Re:OSdev
change "use16" to "[bits 16]" and it should work in nasm aswell.
Re:OSdev
correct.Solar_worm wrote: And I must changetimes 510- ($-start) db 0
dw 0xaa55
to:???times 510- ($-$$) db 0
dw 0xAA55
Not neccesarily needed, you can use "use16" and still it should work.change "use16" to "[bits 16]" and it should work in nasm aswell.
HTH,
DennisCGc.
PS:
You can also use:Code: Select all
lea esi,[msg0]
Code: Select all
mov esi,msg0