KOS In Unix systems

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am

Re: KOS In Unix systems

Post by Chilly Willy » Mon Jan 02, 2012 6:22 pm

Stryfe wrote:
root670 wrote:I'm having similar problems trying to get the toolchain to build. I'm running Ubuntu 11.10 x64. I grabbed the latest revision with SVN and ran the download.sh script, followed by the unpack.sh script. Before running make, I changed the prefixes to this:

Code: Select all

sh_prefix  := $(HOME)/Dreamcast/dc/toolchain/$(sh_target)
arm_prefix := $(HOME)/Dreamcast/dc/toolchain/$(arm_target)
Have you tried the full path instead of the '$(HOME)' variable, or even just '$HOME' without brackets?
This whole issue with $HOME is why I switched to what OSX made "standard" - using /opt. It's now very common for toolchains to go into /opt/toolchains/<platform>, which is what I use. Of course, that doesn't help KOS_BASE any. My environ.sh uses

Code: Select all

export KOS_BASE="/home/jlfenton/Projects/Dreamcast/kos"

export KOS_CC_BASE="/opt/toolchains/dc/sh-elf"		# DC

export DC_ARM_BASE="/opt/toolchains/dc/arm-elf"

export PATH="${PATH}:${KOS_CC_BASE}/bin:/opt/toolchains/dc/bin"
That last bit with a bin directory in the dc directory instead of one of the sh or arm directories is where I keep scramble and all the other x86 tools used for building things.

In the makefile for the toolchain, I just have the prefixes set like this:

Code: Select all

sh_prefix  := /opt/toolchains/dc/$(sh_target)
arm_prefix := /opt/toolchains/dc/$(arm_target)
Assuming you have all the crazy dependencies gcc needs to build, it then goes through without a hitch on Xubuntu.
root670
DCEmu Newbie
DCEmu Newbie
Posts: 4
Joined: Mon Jan 02, 2012 2:17 pm

Re: KOS In Unix systems

Post by root670 » Mon Jan 02, 2012 7:27 pm

I deleted build-gdb- and the target folder (/home/wes/Dreamcast) from /home/wes. I also noticed two broken symbolic links in that folder (arch and dc were their names). I then deleted the whole kos folder that had all of the files from the SVN. I ran "sudo svn co https://cadcdev.svn.sourceforge.net/svnroot/cadcdev kos"

Ran the two scripts in the dc-chain folder, then changed the makefile like i did before, instead using my actual home directory in place of $(HOME). Also changed kos_root to /home/wes/kos for good measure. The prefixes were changed to what Chilly WIlly suggested.

The environ.sh script has been modified with Chilly Willy's suggestions. I ran "sudo make" and it took about 1 hour to complete. Finally got the toolchain built! :)

Now on to building KOS and making sure environ.sh is working. Thanks everyone!

Edit: kos and kos-ports built successfully!
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am

Re: KOS In Unix systems

Post by Chilly Willy » Mon Jan 02, 2012 9:20 pm

Great news! By the way, if you change the permission on /opt, you should be able to build everything without sudo. /opt is supposed to be accessible to any user, and you should be able to access your own home. If you don't want to change all of /opt, you could just change /opt/toolchains instead. Just do "sudo chmod -R 777 /opt/toolchains" to allow any user access to toolchains. You can stick with sudo if you want, I just like not having to sudo any time I update the toolchain or associated libraries/tools.
N64VSNES
DCEmu Freak
DCEmu Freak
Posts: 65
Joined: Sun Apr 10, 2011 12:05 pm

Re: KOS In Unix systems

Post by N64VSNES » Thu Jan 05, 2012 7:59 am

I've finally gotten the KOS to compile, well it was a few days ago but I've had internet problems.

Anywhoo, Everything has compiled fine, the kos-ports and even dcload has compiled and is working just fine.
However, I think something has gone wrong behind the scenes.

For example, if I compile the pvrmark example, and send it to my DC then it runs just fine. No compile or runtime errors.

However, if I create a directory in the examples folder and call it "custom", compile it, I get this:

Code: Select all

make: *** No rule to make target `pvrmark.o', needed by `pvrmark.elf'. Stop.
I've literally copied the contents from one directory, to another, so this should mean there is no reason to fail.

When I change the makefile to directly look for the source files, it just gives me a link error saying undefined reference to "_start". (Entry point I believe?)

EDIT:
It seems the issue getting DC load only exists when I compile a C++ program, C programs work fine.
Now I'm really puzzledd :?:

For all the test programs I've written, when it does compile, I send it to my Dreamcast and dcload just says "executing" and hangs there. It's definitely not a problem with dcload as it sends the examples just fine though.

Am completely puzzled, any suggestions? :?
Post Reply