My print string function
Re:My print string function
as i don?t have any replies yet i will just continue to talk to myself..
i tested to change the jb to ja instead and the 'call scroll_up' to 'call _scroll_up' but all i got is a (general protection?) fault..
This sucks!
/ Christoffer
i tested to change the jb to ja instead and the 'call scroll_up' to 'call _scroll_up' but all i got is a (general protection?) fault..
This sucks!
/ Christoffer
Re:My print string function
Could you mail/send me a copy of your disk image? I'd like to run it in a debugging-bochs.bubach wrote: as i don?t have any replies yet i will just continue to talk to myself..
i tested to change the jb to ja instead and the 'call scroll_up' to 'call _scroll_up' but all i got is a (general protection?) fault..
This sucks!
/ Christoffer
Re:My print string function
ok, but i compile it on a normal floppy..
here?s the source-zip..
[attachment deleted by admin]
here?s the source-zip..
[attachment deleted by admin]
Re:My print string function
*kicks bubach* don't change without thinking!bubach wrote: as i don?t have any replies yet i will just continue to talk to myself..
i tested to change the jb to ja instead and the 'call scroll_up' to 'call _scroll_up' but all i got is a (general protection?) fault..
This sucks!
Excerpt from your zip:
Code: Select all
push edi^M
push esi ; may be a good idea with a unchanged esi^M
^M
mov edi,0b8000h^M
mov esi,0b8000h+160^M
mov ecx,(160*49)/4^M
rep movsd^M
^M
pop ds^M
The memory contains :
Code: Select all
0x9ffc0 <bogus+0>: 0x23 0x4d 0x53 0xae 0x81 0x00 0x00 0x00
0x9ffc8 <bogus+8>: 0x05 0x00 0x00 0x10 0x00 0x00 0x00 0x35
Code: Select all
esp:0x9ffc3
gdtr:base=0x88e4, limit=0x17
PS: your stack pointer is unaligned. Align it .
You might want to pop that esi & edi back again.
Re:My print string function
opps..
i missed that pop ds...
that dosn?t sound that good.. ****!
now i am absolutly sure that i know too little to be programming a OS. i think that i will lay this on ice, and learn asm programming better first..
but whats with those ^M?
/ Christoffer
i missed that pop ds...
that dosn?t sound that good.. ****!
now i am absolutly sure that i know too little to be programming a OS. i think that i will lay this on ice, and learn asm programming better first..
but whats with those ^M?
/ Christoffer
Re:My print string function
That's a common error. You'll learn either way.bubach wrote: i missed that pop ds...
that dosn?t sound that good.. ****!
now i am absolutly sure that i know too little to be programming a OS. i think that i will lay this on ice, and learn asm programming better first..
That's because you use Windows which adds a 0xd 0xa at the end of each line. Linux only reads the 0xa so the 0xd is printed as the thirteenth control character. Control characters are printed as ^ with the character corresponding to them. 0xd thus is ^M.but whats with those ^M?
Use linux line breaks or learn to look over it (like I have).
This also applies in the inverse direction, if you use Linux files in windows it will not recognise the enters and display a mess of code. Check out AtlantisOS source for examples.
PS: half-decent wineditors convert that themselves. Notepad does not.
Re:My print string function
it was the gdt and stack stuff i meant, i don?t understand as much of it that i think i should do to be able to program a OS.Candy wrote: The memory contains :and your stack pointer & gdt are:Code: Select all
0x9ffc0 <bogus+0>: 0x23 0x4d 0x53 0xae 0x81 0x00 0x00 0x00 0x9ffc8 <bogus+8>: 0x05 0x00 0x00 0x10 0x00 0x00 0x00 0x35
so that is WAY over the limit. It ends up at a 81ae which is a LOT more than 0x17.Code: Select all
esp:0x9ffc3 gdtr:base=0x88e4, limit=0x17
PS: your stack pointer is unaligned. Align it .
but thanks for all your help!
/ Christoffer
Re:My print string function
I have found the biggest bug!
all those calculations with 49 that should have been 24 instead.... :-[
how could i be so stupid!
in the os i toke tho functions from he uses a 8x8 font witch make the screen have 80x50 chars instead of 80x25.
/ Christoffer
all those calculations with 49 that should have been 24 instead.... :-[
how could i be so stupid!
in the os i toke tho functions from he uses a 8x8 font witch make the screen have 80x50 chars instead of 80x25.
/ Christoffer
Re:My print string function
Thanks. I missed that toobubach wrote: I have found the biggest bug!
all those calculations with 49 that should have been 24 instead.... :-[
how could i be so stupid!
in the os i toke tho functions from he uses a 8x8 font witch make the screen have 80x50 chars instead of 80x25.
Re:My print string function
the sad thing is that it is still not working.. :'(
Re:My print string function
*goes on a quest to linux to fix your problem*bubach wrote: the sad thing is that it is still not working.. :'(
be back in a few hours
ps: use makefiles.
Re:My print string function
ok. i do use a .bat file that compiles and copies the os.
/ Christoffer
/ Christoffer
Re:My print string function
You seem to be having some trouble with the meaning of some functions and opcodes.
example:
Ignore the ^M's. You place the output value in dx, then pop the old value back in it, and then return. That will never work.
You have a lot of redundant code (inccursor, deccursor and getcursor all manually access the display chip for reading, inccursor, deccursor and setcursor_real all manually access the display chip for writing) and you seem to have a bit of spaghetti in there (two entry points with one exit point is not really looking good)
Also, you seem to use both spaces and tabs to space your code, and are occasionally inconsequent with it. That doesn't look too nice but doesn't in itself break anything.
Also, in the print_char, you have one push ebx, and two pops into edx. That confuses anybody that reads over it.
print starts with a pusha and ends with a popad, which would crash the system if you ran it.
You don't set the copy direction in scroll_up which wrecks your display routine in continuity.
You fill up the nonprinted area with zeroes, while spaces would have been better. Not a bug this, but something that's not entirely clean.
You scroll up after every character, but do not increase the cursor?
You don't set the org for your kernel properly!
The call to your string printing function disassembles as:
Your string is at 0x00100005. You currently try to print the interrupt vector table.
example:
Code: Select all
mov dl,al^M
pop ebx^M
mov dh,bl^M
^M
popad^M
ret^M
You have a lot of redundant code (inccursor, deccursor and getcursor all manually access the display chip for reading, inccursor, deccursor and setcursor_real all manually access the display chip for writing) and you seem to have a bit of spaghetti in there (two entry points with one exit point is not really looking good)
Also, you seem to use both spaces and tabs to space your code, and are occasionally inconsequent with it. That doesn't look too nice but doesn't in itself break anything.
Also, in the print_char, you have one push ebx, and two pops into edx. That confuses anybody that reads over it.
print starts with a pusha and ends with a popad, which would crash the system if you ran it.
You don't set the copy direction in scroll_up which wrecks your display routine in continuity.
You fill up the nonprinted area with zeroes, while spaces would have been better. Not a bug this, but something that's not entirely clean.
You scroll up after every character, but do not increase the cursor?
You don't set the org for your kernel properly!
The call to your string printing function disassembles as:
Code: Select all
(0).[572064] [0x00100230] 0008:00100230 (unk. ctxt): mov ESI, 00000015 ; be15000000
(0).[572064] [0x00100235] 0008:00100235 (unk. ctxt): mov AL, 0e ; b00e
(0).[572064] [0x00100237] 0008:00100237 (unk. ctxt): call 001000cd ; e891feffff
Re:My print string function
Mmm.. Ok, i will be back.
Re:My print string function
The intermediate version I made it to, sorry bout that. Shouldn't have done that, but it might help you with the rest.
[attachment deleted by admin]
[attachment deleted by admin]