doubt with /pc/

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.
Post Reply
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has liked: 0
Been liked: 0
Contact:

doubt with /pc/

Post by dospro » Sun May 28, 2006 7:00 pm

When you try to open a file with /pc/, what pc dir are you really using? C:? the elf dir, dc-tool-ip dir, or what?
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5455
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has liked: 3 times
Been liked: 24 times
Contact:

Post by BlueCrab » Sun May 28, 2006 10:06 pm

If you're using linux or Mac OS X (or any other *nix), its generally /
If you're using Cygwin, its generally the directory that cygwin is installed in (C:\Cygwin)
If you're using MSYS/MinGW, its generally C:\
nogginthenog
DCEmu Fast Newbie
DCEmu Fast Newbie
Posts: 21
Joined: Fri Mar 10, 2006 7:57 am
Has liked: 0
Been liked: 0

Post by nogginthenog » Mon May 29, 2006 9:24 am

I use the following in my Makefile (Cygwin here):

run: $(TARGET).bin
dc-tool.exe -b 115200 -c . -x "$(TARGET).bin"

The '-c' argument tells dc-tool to use the current folder.
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has liked: 0
Been liked: 0
Contact:

Post by dospro » Sun Dec 03, 2006 10:14 am

Problems with the /pc/ thing.
I am using kubuntu linux. I compiled all the dc toolchain and tools(sh, arm, kos, dc-tool-ip).
the problem is that i dont know where does /pc/ directs the program to.
supposdly it is to /(root).
but it is not working like that.

How can i know where is /pc/ taking me?

PD. Using dc-tool-ip 1.0.3 in linux and 1.0.4 on DC.
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has liked: 0
Been liked: 0
Contact:

Post by dospro » Sun Dec 03, 2006 8:24 pm

Ok, i figured something weird.
/pc/ redirects me to the root (/).
What doesn't work is fopen.
Why isn't printf neither fopen working??
This is a KOS problem, isnt it? Supposdly KOs controls the standar lib.
Whats wrong?
Was my compilation that bad?
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
User avatar
semicolo
Mental DCEmu
Mental DCEmu
Posts: 328
Joined: Mon Apr 25, 2005 1:02 pm
Location: Three-rivers canada
Has liked: 0
Been liked: 0
Contact:

Post by semicolo » Wed Dec 06, 2006 11:39 am

does the user that runs dctool have rights to open the files you want to ?

Watch for the path, it works by me.
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has liked: 0
Been liked: 0
Contact:

Post by dospro » Wed Dec 06, 2006 5:20 pm

The file i tried to open is in the home directory, so it is suppose it is not protected.
i tried somethin likes this:

file=fopen("/pc/home/dospro/file", "rb");

And this doesnt open the file, even though the file is there.

What else can ia do?
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
Ex-Cyber
DCEmu User with No Life
DCEmu User with No Life
Posts: 3641
Joined: Sat Feb 16, 2002 1:55 pm
Has liked: 0
Been liked: 0

Post by Ex-Cyber » Thu Dec 07, 2006 2:01 pm

You can use strace to spy on system calls made by a Linux program, which includes file operations.

Are you sure you've declared the file descriptor correctly?
"You know, I have a great, wonderful, really original method of teaching antitrust law, and it kept 80 percent of the students awake. They learned things. It was fabulous." -- Justice Stephen Breyer
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has liked: 0
Been liked: 0
Contact:

Post by dospro » Sat Dec 09, 2006 12:16 am

Well, still a stranger thing.
/cd/file doesnt work either.
It doesnt even read the cd inserted.

hell..
why is this??
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has liked: 0
Been liked: 0
Contact:

Post by dospro » Thu Dec 14, 2006 7:34 pm

Well. is there an alternative to fopen?
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
Post Reply