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.
aztex
Member
Posts: 30 Joined: Sun Mar 02, 2008 8:15 am
Post
by aztex » Mon Apr 21, 2008 9:56 am
my kernel is loading but is not printing anything..
i am using grub..
Kieran
Member
Posts: 54 Joined: Mon Apr 11, 2005 11:00 pm
Post
by Kieran » Mon Apr 21, 2008 10:40 am
Im sorry, but your description provides no clue as to why you are having this problem.
Combuster
Member
Posts: 9301 Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:
Post
by Combuster » Mon Apr 21, 2008 10:43 am
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[
My OS ] [
VDisk/SFS ]
aztex
Member
Posts: 30 Joined: Sun Mar 02, 2008 8:15 am
Post
by aztex » Mon Apr 21, 2008 11:17 am
i wrote a c function to print strings on the screen...
when i booted this kernel in bochs..
it did not print anything..
if i give one print statement the system halts..
if i give more print statement then it restarts..
i have attached the file
Attachments
kmain.c
(1.09 KiB) Downloaded 58 times
Combuster
Member
Posts: 9301 Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:
Post
by Combuster » Mon Apr 21, 2008 11:39 am
What does bochs say before it crashes? Is that all code? how do you compile it? have you read the [wiki]Category:FAQ[/wiki] page about strings? 5)...? 6)...? 7)...? X) ...? Z)....? why is cline not set in clear_screen()?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[
My OS ] [
VDisk/SFS ]
aztex
Member
Posts: 30 Joined: Sun Mar 02, 2008 8:15 am
Post
by aztex » Mon Apr 21, 2008 12:01 pm
ya. only one file..
gcc -c -m32 -B /home/vivek/os/kernel -Wall -nostdlib -nostartfiles -nostdinc -std=gnu99 *.c
as --32 startk.s -o startk.so
'ld -m elf_i386 -T linker.ld startk.so *.o -o kernel'
i use these for compilations..
bochs does not crash.. it keeps on restarting...
piranha
Member
Posts: 1391 Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:
Post
by piranha » Mon Apr 21, 2008 8:28 pm
whats in your 'startk.s' file? Try adding a for loop after the kprint call and see what happens.
-JL
aztex
Member
Posts: 30 Joined: Sun Mar 02, 2008 8:15 am
Post
by aztex » Tue Apr 22, 2008 12:18 am
this is the main function
void main()
{
while(1);
}
but still it rebooots.
i have attached the floopy image..
aztex
Member
Posts: 30 Joined: Sun Mar 02, 2008 8:15 am
Post
by aztex » Tue Apr 22, 2008 12:27 am
sorry i could not upload the floopy image..
aztex
Member
Posts: 30 Joined: Sun Mar 02, 2008 8:15 am
Post
by aztex » Tue Apr 22, 2008 12:29 am
this is the assembly file..
Attachments
[The extension s has been deactivated and can no longer be displayed.]
thepowersgang
Member
Posts: 734 Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:
Post
by thepowersgang » Tue Apr 22, 2008 12:40 am
including the link.ld file would be useful and in an archive would be better.
I can't see much but putting a
after the "hlt" instruction might help and insert
at the bottom of kmain.
Try running it with these and see what it does. If that fails use the bochs debugger to find the error.
aztex
Member
Posts: 30 Joined: Sun Mar 02, 2008 8:15 am
Post
by aztex » Tue Apr 22, 2008 1:25 am
i get undefined reference to _alloca
undefined reference to _main
when i link the files y is it????
JamesM
Member
Posts: 2935 Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:
Post
by JamesM » Tue Apr 22, 2008 2:03 am
Read the FAQ.
You need a crosscompiler.