I need help with my c++ kernel..

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.
EclipseOS

Re:I need help with my c++ kernel..

Post by EclipseOS »

O.K.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:I need help with my c++ kernel..

Post by Neo »

Oops! get the older one(with warnings). as usual re-download from there. fast solns are not the best ones ever :(
Only Human
EclipseOS

Re:I need help with my c++ kernel..

Post by EclipseOS »

Great! Everything works perfect. Thanx for the bootloader Neo. I also was able to write my own endl function into my video driver. Well my first steps have been taken into this complex world. Thanx to you all!
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:I need help with my c++ kernel..

Post by Solar »

@ Candy:

> using nasm for?

The tutorial is about setting up a toolchain targetting ix86-ELF; so I'd like to add a paragraph on how you can use NASM instead of GNU as to generate ELF object files out of Assembler listings.
beyondsociety wrote: At the moment I just compile my assembly files seperate with nasm, then compile the C code and link.
What are the command options you're using for NASM?
Also on the tutorial on cross-compiling: how would I set the target for supporting all formats?. In the example you have it as: export TARGET=i586-elf.
I wish I had an idea. So far, I call /usr/cross/bin/i586-pc-elf-g++ directly...
Every good solution is obvious once you've found it.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:I need help with my c++ kernel..

Post by Candy »

Solar wrote: @ Candy:

> using nasm for?

The tutorial is about setting up a toolchain targetting ix86-ELF; so I'd like to add a paragraph on how you can use NASM instead of GNU as to generate ELF object files out of Assembler listings.
uhm... you have three options:

You want a crosscompiler in which you compile each file to assembly (each file of the compiler itself), convert it to intel-format and then assemble it using nasm, you want a compiler that always uses nasm instead of AS for the normal linking (I can imagine this being really useful, but likewise near-impossible) or you want to plainly create nasm files and link them with C source.

If it's the last, look at my second stage boot loader, it's setup.asm with a bunch of C files, not cleanly linked together (setup.asm has some 16-bit code, so you have to remove those relocations by hand).

I use nasm -f elf -o <output> <source> and then normal LD. Nasm places relocations at the end btw, 8byte REL-relocations. Type 0x14 is 16-bit (I think even all types >0x10).
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:I need help with my c++ kernel..

Post by Solar »

Candy wrote: I use nasm -f elf -o <output> <source> and then normal LD.
That already answers my question, thanks. (PS: I was thinking about the 3rd option you listed.)
Every good solution is obvious once you've found it.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:I need help with my c++ kernel..

Post by Neo »

The secondary loader has been corrected and is here under the name of myboot2.asm (rename it to its original name boot2.asm if you wish)
Use this from now on if you plan to continue using this. All it does is correct those warnings.
Note:- I've also updated the zip file in the earlier post.


[attachment deleted by admin]
Only Human
EclipseOS

Re:I need help with my c++ kernel..

Post by EclipseOS »

Thanx for the bootloader fix. I'm making alot of progress after getting past the whole booting process. Hopefully my kernel will be able to do somthing usefull soon. If and when It can, I'll post a version of it here for y'all to see.
Post Reply