Kernel Print problems

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Kernel Print problems

Post by Neo »

so did it work?
Only Human
Vladaz

Re:Kernel Print problems

Post by Vladaz »

It restarts me when writes "a" and "b". I think it still doesn't work. :'(
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Kernel Print problems

Post by Pype.Clicker »

Code: Select all

        xor bx, bx
   mov es, bx
   mov bx, 60000
Hmm ? how is *this* supposed to work ? are you in unreal mode ? Oh wait! it's mov bx, 60000 and not mov bx,0x60000, thus it will assemble fine.

However, i doubt you wanted to place your kernel at that place .

Code: Select all

 .text 0x100000
in your .ld file let me believe that your kernel expect to be located at 1MB barrier ... correct ?
Vladaz

Re:Kernel Print problems

Post by Vladaz »

Sorry, i forgot to upload new source to the internet.
http://avnet.sytes.net/~vladas/kernel.txt
I updated the link.ld and video.c files like Neo told me.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Kernel Print problems

Post by Neo »

Try the attached one out, you will see that the line gets printed.
The compile.bat file instead of writing to a floppy just generates a image file called 'test.img' give this to bochs and see the output. Let me know what you get.
Only Human
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Kernel Print problems

Post by Neo »

btw it would be more helpful if you use comments in your code.
Only Human
Vladaz

Re:Kernel Print problems

Post by Vladaz »

Yeeee! ;D Now it works. Thank you! ;D
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Kernel Print problems

Post by Neo »

Vladaz wrote: Yeeee! ;D Now it works. Thank you! ;D
yeah it works with a few calls to the print function only. i just realised what was 'wrong'.

The 'error' was that I was using partcopy with the wrong file size. I mean i was testing your code out with a single print statement in kernel_main() and was using the size that was generated by that file. Afterward when i used your code with the other print statements the thing crashed because the whole file was not read in. (I had to run this through BOCHS debugger single-stepping to realize that pure nothing was being executed after a point).
Change the relevant line in the compile.bat file to this

Code: Select all

patcopy kernel.bin 0 200 test.img 200
If it doesn't work after this, knock me down.
Only Human
Post Reply