OSDev.org

The Place to Start for Operating System Developers
It is currently Sat May 18, 2024 7:39 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: when and where to create stack
PostPosted: Tue Jun 10, 2003 11:00 pm 
I am trying to develope small os.
i can load my kernel.
i can print single characters with 10h.
but when i call function and pass pointers for printing string
it is not working.

please help


Top
  
 
 Post subject: RE:when and where to create stack
PostPosted: Tue Jun 10, 2003 11:00 pm 
hm another stack question

anyways, how bad does it do? is it possible to call a function and get back from it? perhaps you've got to set up [org] correctly, and test if DS is correct (I think for you it is DS = CS). You say it is a small kernel, can you post it?

Adrian


Top
  
 
 Post subject: RE:when and where to create stack
PostPosted: Fri Jun 13, 2003 11:00 pm 
Thank you Adek336 for your help.
I got it solved by foll code
before my main in kernel.
If you feel stack is less or can create problems
please let me know




[BITS 16]
group DGROUP _TEXT _DATA _BSS _STACK

extern _main
; ****************************CODE-Segment*********************************
segment _TEXT class=CODE
..start:
main:                mov ax, cs
                     mov ds, ax
                     mov es, ax
                     cli
                     mov ss, ax
                     mov sp, StackEnd
                     sti

                     call _main

.hang:               jmp .hang

; ****************************DATA-Segment*********************************
segment _DATA class=DATA

; ****************************BSS-Segment**********************************
segment _BSS class=BSS

; ****************************STACK-Segment********************************
segment _STACK class=STACK
                     resw 256
StackEnd:


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 35 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