OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 4:11 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Stack problem
PostPosted: Sun Aug 19, 2001 11:00 pm 


Top
  
 
 Post subject: RE:Stack problem
PostPosted: Sun Aug 19, 2001 11:00 pm 
what must i change that i can call functions:


Top
  
 
 Post subject: RE:Stack problem
PostPosted: Sun Aug 19, 2001 11:00 pm 
what must i change that i can call functions:


[BITS 16]
[org 0x0]

jmp start
nop
;******************************RESET UND

LOAD**************************
reset:
push ds
mov ax, 0
mov dl, [bootdrv]
int 13h
pop ds
jc reset

load:
mov ax, 0x1000
mov es, ax
mov bx, 0
mov ah, 2
mov al, 20 ;sektoren
mov cx, 2
mov dx, 0
int 13h
jc load
retn
;*********************************MESSAGE********************

**********
message:
lodsb
or al,al
jz done
mov ah,0eh
mov bx,0007
int 0x10
jmp message
done:
ret

;*********************************DATEN***********************

***********
bootdrv db 0

loadmsg db 'Loading kernel',13,10,0
jumpmsg db 'Jumping to kernel',13,10,0
pmodemsg db 'Entering PMode',13,10,0

gdt:
length dw gdtlength
base dd gdt_table + 0x7C00
;***************************************************************

************
start:
mov ax, 0x7c0
mov ds, ax
cli
mov ax, 0x9000
mov ss, ax
mov sp, 0xffff
sti

mov [bootdrv], dl
.386
mov si, loadmsg
call message
call load

lgdt [ds:gdt]
mov si, pmodemsg
call message
mov si, jumpmsg
call message
cli
mov eax, cr0
or eax, 1
mov cr0, eax
mov eax, 98000h
mov esp, eax


jmp DWORD 0x10:0x10000


;***************************************************************

*******;
gdt_table:

null_desc:
dw 0
dw 0
db 0
db 00000000b
db 00000000b
db 0

huge_desc_data:
dw 0xFFFF
dw 0000h
db 00h
db 10010010b
db 11001111b
db 00h

huge_desc_code:
dw 0xFFFF
dw 0000h
db 00h
db 10011010b
db 11000000b
db 00h

stack_desc:
dw 0xFFFF
dw 0x0000
db 10h
db 10010110b
db 11000000b
db 00h

;***************************************************************

*****;

gdtlength equ $ -gdt_table -1

times 512-($-$$)-2 db 0
dw 0AA55h


Top
  
 
 Post subject: RE:Stack problem
PostPosted: Mon Aug 20, 2001 11:00 pm 
Ok first off you really can't stack the packages
you need to do them one at a time. Tony was having a
similar problem if you will read down 2 messages ago
if you want good popping ratio the trick is, lay the kernels
flat and even. this should fix your problem


Top
  
 
 Post subject: RE:Stack problem
PostPosted: Tue Aug 21, 2001 11:00 pm 
>On 2001-08-21 15:57:55, Kernel Master wrote:
>Ok first off you really can't stack the packages
>you need to do them one at a time. Tony was having a
>similar problem if you will read down 2 messages ago
>if you want good popping ratio the trick is, lay the kernels
>flat and even. this should fix your problem
hmmmmm
I had compiled my kernel with gcc and linked it with
ld
gcc -ffreestanding -c -o kernel.o kernel.c
ld -Ttext 0x10000 --oformat binary -o kernel.bin kernel.o
where can i switch the memory model to flat memory


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 149 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group