DC-chain / Kos 2.0 Installation Errors
- PH3NOM
- DC Developer
- Posts: 576
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Fri Jun 18, 2010 9:29 pm
- Has thanked: 0
- Been thanked: 5 times
DC-chain / Kos 2.0 Installation Errors
Whats up guys.
I have not touched and code on DC for the last month or so, ever since I installed my new OS and have not yet re-installed the DC tool chain.
Since Dev Iso R4 is no longer hosted on this site, I decided to break down and install kos 2.0 from the ground up.
First, I installed Cygwin.
Next, I downloaded kos 2.0, newlib-2.0, gcc-4.7.3, and binutils-2.23.2. To be certain, the newlib version I am using is "newlib-linaro-2.0.0-2013.06.tar".
Running the kos/utils/dc-chain makefile, the patch seems to run fine, but it fails to build-sh4.
Any help will be appreciated!
I have not touched and code on DC for the last month or so, ever since I installed my new OS and have not yet re-installed the DC tool chain.
Since Dev Iso R4 is no longer hosted on this site, I decided to break down and install kos 2.0 from the ground up.
First, I installed Cygwin.
Next, I downloaded kos 2.0, newlib-2.0, gcc-4.7.3, and binutils-2.23.2. To be certain, the newlib version I am using is "newlib-linaro-2.0.0-2013.06.tar".
Running the kos/utils/dc-chain makefile, the patch seems to run fine, but it fails to build-sh4.
Any help will be appreciated!
- SWAT
- Insane DCEmu
- Posts: 193
- Joined: Sat Jan 31, 2004 2:34 pm
- Location: Russia/Novosibirsk
- Has thanked: 1 time
- Been thanked: 0
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
Just remove -j4 from makejobs variable in Makefile. I think it help you, I'm build all fine.
I say the problem is more serious
After build the KOS on gcc 4.8.2 it works very not stably... setting video mode broken and maybe even a problem with mutex/thread (but I'm not sure yet).
When DC connected to composite cable, then why in this place, a condition that is triggered cable VGA, so the video only works with VGA connection:
I don't touch anything, kos does it himself.
I think variable vid_mode is crashed on some place. And not only it global variable...
I say the problem is more serious
After build the KOS on gcc 4.8.2 it works very not stably... setting video mode broken and maybe even a problem with mutex/thread (but I'm not sure yet).
When DC connected to composite cable, then why in this place, a condition that is triggered cable VGA, so the video only works with VGA connection:
Code: Select all
/* If we're on a VGA box, disable vertical smoothing */
if(vid_mode->cable_type == CT_VGA) {
dbglog(DBG_KDEBUG, "pvr: disabling vertical scaling for VGA\n");
if(pvr_state.fsaa)
PVR_SET(PVR_SCALER_CFG, 0x10400);
else
PVR_SET(PVR_SCALER_CFG, 0x400);
}
else {
dbglog(DBG_KDEBUG, "pvr: enabling vertical scaling for non-VGA\n");
if(pvr_state.fsaa)
PVR_SET(PVR_SCALER_CFG, 0x10401);
else
PVR_SET(PVR_SCALER_CFG, 0x401);
}
I think variable vid_mode is crashed on some place. And not only it global variable...
Last edited by SWAT on Thu Dec 05, 2013 9:24 pm, edited 2 times in total.
- BlueCrab
- The Crabby Overlord
- Posts: 5690
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 10 times
- Been thanked: 70 times
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
Well, first of all, you're not using an official version of newlib. I have no idea if that particular tarball you've downloaded has changed anything significant, but I wouldn't necessarily want to chance it. Get the real version of newlib, which the download.sh script in dc-chain will do for you (or at least point you to the right place to get it).
Second, there's a known issue with the bfd.texinfo file (which is actually why your build is failing) and newer versions of the tool used with it. This was discussed in this topic recently, and the solution is in this post specifically. To save you from having to click on the link, here's that post:
Just to be clear, this has nothing to do with using multiple jobs for make or with any GCC 4.8.x related bugs (which I haven't seen any of myself, but that's beside the point anyway, since you're not using GCC 4.8.x).
Second, there's a known issue with the bfd.texinfo file (which is actually why your build is failing) and newer versions of the tool used with it. This was discussed in this topic recently, and the solution is in this post specifically. To save you from having to click on the link, here's that post:
As stated in that post, it is fixed on the git repository, so any future releases of KOS (after 2.0.0) won't have that problem.BlueCrab wrote:That's a bug in the binutils texinfo files. I never build them with my builds, so I had never noticed that issue...
Re-run the unpack.sh script, then run the following two commands before doing the make:This will be fixed in the git when I update the dc-chain Makefile again.Code: Select all
sed -e 's/ @colophon/ @@colophon/' -e 's/doc@cygnus.com/doc@@cygnus.com/' binutils-2.23.2/bfd/doc/bfd.texinfo > binutils-2.23.2/bfd/doc/bfd.texinfo2 mv binutils-2.23.2/bfd/doc/bfd.texinfo2 binutils-2.23.2/bfd/doc/bfd.texinfo
Just to be clear, this has nothing to do with using multiple jobs for make or with any GCC 4.8.x related bugs (which I haven't seen any of myself, but that's beside the point anyway, since you're not using GCC 4.8.x).
- SWAT
- Insane DCEmu
- Posts: 193
- Joined: Sat Jan 31, 2004 2:34 pm
- Location: Russia/Novosibirsk
- Has thanked: 1 time
- Been thanked: 0
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
Sorry for offtopic, I'm just saying of bug in 4.8.2 for you BlueCrab. You use it by default in dc-chain.
With 4.7.3 I'm not have this bug.
With 4.7.3 I'm not have this bug.
- BlueCrab
- The Crabby Overlord
- Posts: 5690
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 10 times
- Been thanked: 70 times
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
Someone else was reporting a similar issue with trying to use PAL50 modes and it deciding to use VGA instead, but I'm pretty sure that this person wasn't trying to use GCC 4.8.x. That was covered in this topic. Eventually he got everything working, but I dunno what he did to fix it. I'm guessing something got built wrong somewhere along the way, and rebuilding the toolchain fixed it for him.
That said, yes, the Git version of KOS has 4.8.2 as the GCC version, and it works fine for me. I haven't had any issues using it thus far, and being that the other person who has reported a similar problem wasn't using 4.8.x, I'm going to guess there's something else wrong that isn't related to GCC itself.
That said, yes, the Git version of KOS has 4.8.2 as the GCC version, and it works fine for me. I haven't had any issues using it thus far, and being that the other person who has reported a similar problem wasn't using 4.8.x, I'm going to guess there's something else wrong that isn't related to GCC itself.
- SWAT
- Insane DCEmu
- Posts: 193
- Joined: Sat Jan 31, 2004 2:34 pm
- Location: Russia/Novosibirsk
- Has thanked: 1 time
- Been thanked: 0
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
Possible. With video modes have any strange problems for a long time, after start using 4.x in principle. This problem is very difficult to catch. May want to disable some optimizations?
As far as I understood from this topic, he eventually build it up on the old compilers of DCDev r4...
As far as I understood from this topic, he eventually build it up on the old compilers of DCDev r4...
- BlueCrab
- The Crabby Overlord
- Posts: 5690
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 10 times
- Been thanked: 70 times
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
It was my understanding that he got a newer compiler working, since he said that went OK on his machine itself, just not in a VM.
- SWAT
- Insane DCEmu
- Posts: 193
- Joined: Sat Jan 31, 2004 2:34 pm
- Location: Russia/Novosibirsk
- Has thanked: 1 time
- Been thanked: 0
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
Do not you think it is very strange?
I have tried to build code under linux and under cygwin, no difference. And how can there be a virtual machine is to blame I do not understand. I think he did something on that he did not pay attention unfortunately... Perhaps when linking something to interchange places for object files/libs or something. It's not fix a problem, it's just fortune.
I have tried to build code under linux and under cygwin, no difference. And how can there be a virtual machine is to blame I do not understand. I think he did something on that he did not pay attention unfortunately... Perhaps when linking something to interchange places for object files/libs or something. It's not fix a problem, it's just fortune.
- SWAT
- Insane DCEmu
- Posts: 193
- Joined: Sat Jan 31, 2004 2:34 pm
- Location: Russia/Novosibirsk
- Has thanked: 1 time
- Been thanked: 0
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
I'm just compile example on 4.8.2...
Aaaaand 2 errors!
"disabling vertical scaling for VGA" (DC uses composite cable! Why he thinks that the cable VGA?)
"file '/rd/fruit.kmg' is incompatible" (Why it's hapen?)
I think that the network stack do not work for me for the same reason, since version 4.5.2.
I talked about this 2 year ago, I still have not found cause.
This is a complex glitch cause must be sought not in the specific code...
I have attached two examples, please try them on your hardware.
Code: Select all
thd: pre-emption enabled, HZ=100
maple: active drivers:
Dreameye (Camera): Camera
Sound Input Peripheral: Microphone
PuruPuru (Vibration) Pack: JumpPack
VMU Driver: Clock, LCD, MemoryCard
Mouse Driver: Mouse
Keyboard Driver: Keyboard
Controller Driver: Controller
DMA Buffer at ac0b7fe0
vid_set_mode: 640x480 NTSC
fs_romdisk: mounting image at 0x8c0419b8 at /rd
dc-load console support enabled
maple: attached devices:
B0: Dreamcast Controller (01000000: Controller)
B1: Visual Memory (0e000000: Clock, LCD, MemoryCard)
B2: Visual Memory (0e000000: Clock, LCD, MemoryCard)
Use the DPAD to move the modifier square around (it starts at (320, 240))
Press Start to exit.
pvr: disabling vertical scaling for VGA
kmg_to_img: file '/rd/fruit.kmg' is incompatible:
magic 00474d4b version 0 platform 1
Failed to load /rd/fruit.kmg
arch: shutting down kernel
maple: final stats -- device count = 3, vbl_cntr = 20, dma_cntr = 18
vid_set_mode: 640x480 NTSC
fs_romdisk: unmounting image at 0x8c0419b8 from /rd
"disabling vertical scaling for VGA" (DC uses composite cable! Why he thinks that the cable VGA?)
"file '/rd/fruit.kmg' is incompatible" (Why it's hapen?)
I think that the network stack do not work for me for the same reason, since version 4.5.2.
I talked about this 2 year ago, I still have not found cause.
This is a complex glitch cause must be sought not in the specific code...
I have attached two examples, please try them on your hardware.
- Attachments
-
- examples.7z
- (719.28 KiB) Downloaded 257 times
- BlueCrab
- The Crabby Overlord
- Posts: 5690
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 10 times
- Been thanked: 70 times
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
For the time being, I've rolled back the GCC version used by dc-chain in the git repository until I have a chance to actually sit down and investigate what's going on.
- BlueCrab
- The Crabby Overlord
- Posts: 5690
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 10 times
- Been thanked: 70 times
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
So, the problem about fruit.kmg being incompatible is actually an issue with an incompatibility between your host machine (PC) compiler and the code for vqenc. Basically, that particular tool assumes that you're using a machine where sizeof(unsigned long) == 4 and sizeof(unsigned int) == 4. This would not be true on a 64-bit machine compiling 64-bit binaries. I've fixed that in the git repository.
- PH3NOM
- DC Developer
- Posts: 576
- Joined: Fri Jun 18, 2010 9:29 pm
- Has thanked: 0
- Been thanked: 5 times
Re: DC-chain / Kos 2.0 Installation Errors
Thanks for the responses guys!BlueCrab wrote:Well, first of all, you're not using an official version of newlib. I have no idea if that particular tarball you've downloaded has changed anything significant, but I wouldn't necessarily want to chance it. Get the real version of newlib, which the download.sh script in dc-chain will do for you (or at least point you to the right place to get it).
Second, there's a known issue with the bfd.texinfo file (which is actually why your build is failing) and newer versions of the tool used with it. This was discussed in this topic recently, and the solution is in this post specifically. To save you from having to click on the link, here's that post:As stated in that post, it is fixed on the git repository, so any future releases of KOS (after 2.0.0) won't have that problem.BlueCrab wrote:That's a bug in the binutils texinfo files. I never build them with my builds, so I had never noticed that issue...
Re-run the unpack.sh script, then run the following two commands before doing the make:This will be fixed in the git when I update the dc-chain Makefile again.Code: Select all
sed -e 's/ @colophon/ @@colophon/' -e 's/doc@cygnus.com/doc@@cygnus.com/' binutils-2.23.2/bfd/doc/bfd.texinfo > binutils-2.23.2/bfd/doc/bfd.texinfo2 mv binutils-2.23.2/bfd/doc/bfd.texinfo2 binutils-2.23.2/bfd/doc/bfd.texinfo
Just to be clear, this has nothing to do with using multiple jobs for make or with any GCC 4.8.x related bugs (which I haven't seen any of myself, but that's beside the point anyway, since you're not using GCC 4.8.x).
You are right as usual Mr. BlueCrab! Everything seems to be building right now. With any luck, I will post back later when I actually get to compiling some code under the new tool chain.
EDIT #1:
It seems to have hit another snag, specifically during build-sh4-gcc-pass2
I have gotten things to work by disabling the objective c support
Line 56 in the Makefile, I had to change this
Code: Select all
pass2_languages=c,c++,objc,obj-c++
Code: Select all
pass2_languages=c,c++
- BlueCrab
- The Crabby Overlord
- Posts: 5690
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 10 times
- Been thanked: 70 times
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
PH3NOM, Cygwin seems to have all kinds of nasty issues lately for some reason. That said, I haven't actually tried compiling 4.7.3 on Cygwin, but I did build 4.8.2 with it and it seemed to work without issue. Of course, unless you're planning on using Objective C, you're fine just working around it in the way you did.
Onto SWAT's issue... So, I'm pretty sure I have that VGA detection issue sorted out as well. I realized after I posted that I hadn't had any issues that I was running my DC off of a VGA box every time I've tested it with 4.8.2. So, I hooked it up via a composite cable and, sure enough, ran into the same bug. Anyway, it was a really silly issue, and thus easily fixed. Basically, there's a function that detects the video cable type attached by reading some registers. Well, those reads should have been done through a volatile pointer, which wasn't the case in the code. So, I fixed that and the problem disappeared. This might well have fixed that other person's issue too, although I suppose unless he comes back, we'll never know.
Onto SWAT's issue... So, I'm pretty sure I have that VGA detection issue sorted out as well. I realized after I posted that I hadn't had any issues that I was running my DC off of a VGA box every time I've tested it with 4.8.2. So, I hooked it up via a composite cable and, sure enough, ran into the same bug. Anyway, it was a really silly issue, and thus easily fixed. Basically, there's a function that detects the video cable type attached by reading some registers. Well, those reads should have been done through a volatile pointer, which wasn't the case in the code. So, I fixed that and the problem disappeared. This might well have fixed that other person's issue too, although I suppose unless he comes back, we'll never know.
- PH3NOM
- DC Developer
- Posts: 576
- Joined: Fri Jun 18, 2010 9:29 pm
- Has thanked: 0
- Been thanked: 5 times
Re: DC-chain / Kos 2.0 Installation Errors
Had another tool chain error, on the fixup phase it threw an error about permission denied.
The solution was to run the Cygwin terminal as administrator, as I am using Windows 8.
Now, I have successfully built the dc-chain, and set the based on the /doc/environ.sh.sample but edited for my working directory.
Attempting to build KOS begins nicely, but then throws an error when it gets to building the sound code:
The solution was to run the Cygwin terminal as administrator, as I am using Windows 8.
Now, I have successfully built the dc-chain, and set the
Code: Select all
. ./environ.sh
Attempting to build KOS begins nicely, but then throws an error when it gets to building the sound code:
- BlueCrab
- The Crabby Overlord
- Posts: 5690
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 10 times
- Been thanked: 70 times
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
64-bit Cygwin seems to be quite unstable. I'd recommend not using a 64-bit version of Cygwin until they fix the various problems it seems to have. See this topic for other issues that seem to happen earlier in the process on a 64-bit Cygwin.
If you want specifics of what to install in a 32-bit Cygwin to make things work, I posted what worked for me in this post. Mind you, I didn't actually use this Cygwin toolchain beyond compiling KOS (it was built on a machine at my work, so I didn't have a Dreamcast around to test it out more thoroughly), but it did work for building KOS when I used a 32-bit version of Cygwin.
If you want specifics of what to install in a 32-bit Cygwin to make things work, I posted what worked for me in this post. Mind you, I didn't actually use this Cygwin toolchain beyond compiling KOS (it was built on a machine at my work, so I didn't have a Dreamcast around to test it out more thoroughly), but it did work for building KOS when I used a 32-bit version of Cygwin.
- PH3NOM
- DC Developer
- Posts: 576
- Joined: Fri Jun 18, 2010 9:29 pm
- Has thanked: 0
- Been thanked: 5 times
Re: DC-chain / Kos 2.0 Installation Errors
Okay, since this has been a logistical nightmare regarding 32bit/64bit, and I just got things working, I will post my own tutorial for how to build a working KOS 2.0 Dreamcast Tool Chain / Compiler.BlueCrab wrote:64-bit Cygwin seems to be quite unstable. I'd recommend not using a 64-bit version of Cygwin until they fix the various problems it seems to have. See this topic for other issues that seem to happen earlier in the process on a 64-bit Cygwin.
If you want specifics of what to install in a 32-bit Cygwin to make things work, I posted what worked for me in this post. Mind you, I didn't actually use this Cygwin toolchain beyond compiling KOS (it was built on a machine at my work, so I didn't have a Dreamcast around to test it out more thoroughly), but it did work for building KOS when I used a 32-bit version of Cygwin.
1.) Install Cygwin 32bit, setup-x86.exe from here http://cygwin.com/install.html
1.a) Click next twice, making sure to install from internet.
1.b) Chose install directory. I chose d:\cygwin. Click next.
1.c) Chose download directory. Does not effect install directory. Click next 3 times.
1.d) Chose packages to install. I chose Devel, Libs, and Utils. Your screen should look like this:
1.e) Click next. When the download and install is completed ( this can take some time ), Cygwin should be good to go.
2.) Run 32bit Cygwin Terminal as administrator
3.) Download kos-2.0.0-src.tar.gz from here http://sourceforge.net/projects/cadcdev ... ios/2.0.0/
3.a) Create a folder /dc/ in your /Cygwin/usr/local/ folder
3.b) Create a folder /kos/ in your /Cygwin/usr/local/dc/ folder
3.c) Extract the contents of /kos-2.0.0-src/ into your /Cygwin/usr/local/dc/kos/ folder
4.) Install the DC-Chain
4.a) Download this patch I made thanks to BlueCrab and extract into your dc-chain folder 4.b) In cygwin, navigate to your dc-chain folder. Since I installed the chain on my d:, my command is
Code: Select all
cd d:/cygwin/usr/local/dc/kos/utils/dc-chain
Code: Select all
./download.sh
Code: Select all
./unpack.sh
Code: Select all
./patch.sh
Code: Select all
make
5.a) Download this environ.sh and extract into your /Cygwin/usr/local/dc/kos/ folder 5.b) Navigate to your kos directory in Cygwin. Since I installed the chain on my d:, my command is
Code: Select all
cd d:/cygwin/usr/local/dc/kos
Code: Select all
. ./environ.sh
Code: Select all
make
I hope that helps!
- SWAT
- Insane DCEmu
- Posts: 193
- Joined: Sat Jan 31, 2004 2:34 pm
- Location: Russia/Novosibirsk
- Has thanked: 1 time
- Been thanked: 0
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
I thought so Thanks! But I think that this is not the end of gcc 4.8.3 bugs featuresBlueCrab wrote:Well, those reads should have been done through a volatile pointer, which wasn't the case in the code.
I'll let you know if I find out something else.
- BlueCrab
- The Crabby Overlord
- Posts: 5690
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 10 times
- Been thanked: 70 times
- Contact:
Re: DC-chain / Kos 2.0 Installation Errors
Yeah... I wouldn't be surprised if there aren't other places in the code that have the same problem. In fact, I'd actually be very surprised if there wasn't at least one other place where such things are happening.SWAT wrote:I thought so Thanks! But I think that this is not the end of gcc 4.8.3 bugs featuresBlueCrab wrote:Well, those reads should have been done through a volatile pointer, which wasn't the case in the code.
I'll let you know if I find out something else.
Re: DC-chain / Kos 2.0 Installation Errors
Where can I download dc-chain?
What I don't understand with DC development is how there is no real SDK for it, I mean like KOS but only 1 kit packed together with everything needes to make a DC game + a Manual (How to make a code a DC game)
It would make DC dev'ing way more handy.
What I don't understand with DC development is how there is no real SDK for it, I mean like KOS but only 1 kit packed together with everything needes to make a DC game + a Manual (How to make a code a DC game)
It would make DC dev'ing way more handy.
Last edited by HUCAST on Thu Feb 12, 2015 2:40 pm, edited 1 time in total.