What kind of program I use to create file.ELF in Linux?
Program to create files .ELF in Linux ??
Sony Programming and DevelopmentWhat I need is a program to write the code and save it as. ELF to be sent to TOOL.
I am a bit novice ..
I am a bit novice ..
I don't know much about programming yet myself, (we're learning that this year at tech), but one of my teachers told me you need to know MIPS programming which is a different kettle of fish apparently??
I don't know what the differences are yet, but to make an .ELF looks pretty straight forward to me.
I saw that there are different versions of Codewarriors, which is what you use?
runs on Linux?
CentOS 5.7
What you use to create elfs is the SDK toolchain.
Codewarrior is an IDE (it tells the toolchain to take the C source files you wrote) and do some voodoo with the libraries and header files, from that it makes an executable and linkable file (ELF). :nod:
Same thing as you type make on a directory where all stuff is ready made (in this case make will perform the compile script and build your ELF file).
So Codewarrior alone will not take you anywhere. :shrug:
Codewarrior is an IDE (it tells the toolchain to take the C source files you wrote) and do some voodoo with the libraries and header files, from that it makes an executable and linkable file (ELF). :nod:
Same thing as you type make on a directory where all stuff is ready made (in this case make will perform the compile script and build your ELF file).
So Codewarrior alone will not take you anywhere. :shrug:
Just see it as a kind of sport. You can get the basics in a reasonable amount of time, but it takes a lot of hard training to get good at. No pain, no gain.
[And I can't believe it was me who just did a sports comparison... :lol:]
If programming end-user applications in something like Java or .NET, you usually need not care on which machine architecture (single core, multi-core with shared memory, multi-core without shared memory, ...) you will be running. Your "programming model" will be what your runtime system has to offer (JVM, CLR, ...).
In other environments, you may need to care on which machine type you run, what your instruction set has to offer (particularly for low-level operating system stuff like drivers), and sometimes even what particular kind of processor you are running on ("Is that weird semi-documented CPU bug, that I first heard about when eating a pizza with one of the hardware guys last week, also responsible for our program's crashes?").
Now the bad news: there seems to be a tendency (at least from what I have heard) to educate students towards developing in high-level languages (like Java, .NET, Ruby, Python, HTML [yikes!] and JavaScript [!!YIKES!!] and so on). While I don't have anything against these languages or the people using them (To each his own), I think these languages are everything but ideal for beginners, at least not for every sub-field of software development imaginable.
If you never have to worry about memory management (a common misconception of beginning Java and .NET developers), there is a certain chance you'll never get it right in languages like C where you absolutely need to do so, or your program goes ballistic. Likewise, if you are accustomed only to shared-memory multi-threaded programs, programming for really big clusters (= message-passing environments) will be extremely difficult. And there will still be issues your programming language and environment does not abstract away, which may also depend on your actual processor or programming environment; and this stuff will bite you eventually :evil: (just two keywords: double-checked locking in Java, and [beware of acute brain damage; read at your own risk] Memory Consistency Models).
Comming back to the PS2: yes, the system uses a MIPS CPU (actually two of them, one accompanied by custom vector processors), but again depending on what you want to do, you may never need to come into contact with MIPS assembly language. I'd expect most applications on the PS2 being coded entirely in C, with absolutely no MIPS assembly written by the average programmer. There will be some parts of dvp assembler (sorry, no C for the vector units), but its nothing to worry about.
What will be something to worry about (and you may have already interpreted that into some of the lines written above) is computer architecture. Like any embedded system, the PS2 differs in some key parts from regular machines, even those using MIPS processors: the way the CPU interacts with other components. Its no "standard MIPS" with some custom hardware thrown in for good measure, but the way this custom hardware is wired to the rest dictates what you can and need to do in software. You can get away with just ignoring that and hacking away (and for the first "Hello, World"-style programs, I actually encourage you to do so, even if it is just to come into contact with the more obscure aspects of the system), but please do not expect any decent performance then. The CPUs are too slow to do every data-type conversion on-the-fly; there is a reason that resources (such as textures, 3D models, sounds and so on) are delivered in pre-processed form on game discs, as it frees up valuable CPU time for more important things (enemy AI
).To create your ELFs: write your code (in C, MIPS ASM, DVP ASM, whatever), compile, link, run. Simple :Rock:.
There are gcc versions (both from the Sony and homebrew SDK, the latter at ps2dev.org) for the PS2, and there is plenty of sample code available.
I strongly suggest reading the official documentation (not the one for the Sony libraries, but the hardware docs), which if I remember correctly has also been included in a fairly recent edition (5th out of 6th?) in the official Linux kit; and this stuff should also be floating all around the net.
Your Sony PS2 SDK has "sample" folders under both the EE and IOP branch, and each sample should have a readme with instructions on how to build and run it on the TOOL.
Happy coding :033:.
======================================================================
EE Sample Program Compilation/Execution
----------------------------------------------------------------------
By executing the following command under sce/ee/sample, all the sample
program compilation is available. For individual compilation, please
execute the make command under the directory where the program exists.
$ make
By executing the following command, the sample execution is available.
$ make run
Note:
Some sample programs might not be executed by the command above.
Refer to the respective readme_e.txt files for execution procedure.
Also, the dsedb command is used to run the program. The dsedb command is
originally for a debugger, but it is also used only to run the program.
When the execute form file is sample.elf, for instance, input as follows:
$ dsedb -d targetname (or IP address) -r run sample.elf
To run the program by starting the debugger, input the following:
$ dsedb -d targetname (or IP address)
dsedb (Version x.x.xx................)
*** Resetting...
(type 'help' for getting help)
dsedb > run sample.elf
======================================================================
When I give the command make run basic3d (for example) gives me these errors:
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample19.c | \
sed 's/\(sample19\)\.o[ :]*/\1.o sample19.d :/g' > sample19.d; \
[ -s sample19.d ] || rm -f sample19.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample18.c | \
sed 's/\(sample18\)\.o[ :]*/\1.o sample18.d :/g' > sample18.d; \
[ -s sample18.d ] || rm -f sample18.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample17.c | \
sed 's/\(sample17\)\.o[ :]*/\1.o sample17.d :/g' > sample17.d; \
[ -s sample17.d ] || rm -f sample17.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample16.c | \
sed 's/\(sample16\)\.o[ :]*/\1.o sample16.d :/g' > sample16.d; \
[ -s sample16.d ] || rm -f sample16.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample15.c | \
sed 's/\(sample15\)\.o[ :]*/\1.o sample15.d :/g' > sample15.d; \
[ -s sample15.d ] || rm -f sample15.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample14.c | \
sed 's/\(sample14\)\.o[ :]*/\1.o sample14.d :/g' > sample14.d; \
[ -s sample14.d ] || rm -f sample14.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample13.c | \
sed 's/\(sample13\)\.o[ :]*/\1.o sample13.d :/g' > sample13.d; \
[ -s sample13.d ] || rm -f sample13.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample12.c | \
sed 's/\(sample12\)\.o[ :]*/\1.o sample12.d :/g' > sample12.d; \
[ -s sample12.d ] || rm -f sample12.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample11.c | \
sed 's/\(sample11\)\.o[ :]*/\1.o sample11.d :/g' > sample11.d; \
[ -s sample11.d ] || rm -f sample11.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample10.c | \
sed 's/\(sample10\)\.o[ :]*/\1.o sample10.d :/g' > sample10.d; \
[ -s sample10.d ] || rm -f sample10.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample9.c | \
sed 's/\(sample9\)\.o[ :]*/\1.o sample9.d :/g' > sample9.d; \
[ -s sample9.d ] || rm -f sample9.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample8.c | \
sed 's/\(sample8\)\.o[ :]*/\1.o sample8.d :/g' > sample8.d; \
[ -s sample8.d ] || rm -f sample8.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample7.c | \
sed 's/\(sample7\)\.o[ :]*/\1.o sample7.d :/g' > sample7.d; \
[ -s sample7.d ] || rm -f sample7.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
set -e
../../../gcc/bin/ee-gcc -M -I. -I../../../include -I../../../include sample6.c | \
sed 's/\(sample6\)\.o[ :]*/\1.o sample6.d :/g' > sample6.d; \
[ -s sample6.d ] || rm -f sample6.d
/bin/sh: ../../../gcc/bin/ee-gcc: Permission denied
Apparently you're running from an user account which is not authorized to access the directories where the toolchain is installed.
I don't know much of UNIX so I can't really tell you how to fix, but I can tell you that each file on UNIX has a sort of tag which tell the system who has rights to access each file.
If you're desperate, you could try to run make again but using the "superuser" account (root) but again, people will mostly advice you to do not as you can easily and mistakenly issue commands which can cause massive data loss. :nod:
I don't know much of UNIX so I can't really tell you how to fix, but I can tell you that each file on UNIX has a sort of tag which tell the system who has rights to access each file.
If you're desperate, you could try to run make again but using the "superuser" account (root) but again, people will mostly advice you to do not as you can easily and mistakenly issue commands which can cause massive data loss. :nod:
Try this:
- su -
- (Enter root password)
- cd /usr/local/sce
- chown -R <user>:<user> .
- exit
You are running make on the development PC, NOT on the TOOL, right?
To list file owners and access rights, run "ls -lisa" (easy to remember, right? ;-)). You basically get 10 bits of flags+access rights for each file, for example: "-rwxr.xr.x". From left to right, these are:
- One character: file type. "-" is a file, "d" a directory. There are others as well, but these are the most common.
- 3 characters for the owning user, primary group and "all others" each.
I did everything you wrote above but I get the same error as before, it seems it does not run the Makefile.
Then I did not understand how I can give the command to run dsedb which is contained in the / bin directory and sample files in the / ee / sample..come do you catch them from the directory without specifying the path?
Then I did not understand how I can give the command to run dsedb which is contained in the / bin directory and sample files in the / ee / sample..come do you catch them from the directory without specifying the path?
Can you please issue the following commands (using the same user account with which compilation fails) and paste the output here?
- whoami
- groups
- ls -lisa /usr/local/sce/ee/gcc/bin
By setting DSNETM to your TOOL's IP address, you can avoid having to specify the -d parameter to SDK utilities. You can also use a name instead of an IP address if you have a suitable resolver like BIND running.
roberto
[roberto@Host-001 /]$ groups
roberto
[roberto@Host-001 /]$ ls -lisa /usr/local/sce/ee/gcc/bin
totale 47136
1180722 8 drwxrwxrwx 2 roberto roberto 4096 22 dic 01:55 .
1180721 8 drwxr-xr-x 10 roberto root 4096 22 dic 01:56 ..
1180723 264 -rw-r--r-- 1 roberto roberto 260593 17 gen 2002 bison
1180724 212 -rw-r--r-- 1 roberto roberto 207918 17 gen 2002 byacc
1180725 80 -rw-r--r-- 1 roberto roberto 71688 17 gen 2002 cmp
1180726 240 -rw-r--r-- 1 roberto roberto 237042 17 gen 2002 diff
1180727 96 -rw-r--r-- 1 roberto roberto 89240 17 gen 2002 diff3
1180728 1364 -rw-r--r-- 1 roberto roberto 1388229 17 gen 2002 ee-addr2line
1180729 1296 -rw-r--r-- 1 roberto roberto 1318352 17 gen 2002 ee-ar
1180730 2128 -rw-r--r-- 1 roberto roberto 2169068 17 gen 2002 ee-as
1180732 340 -rw-r--r-- 1 roberto roberto 337854 17 gen 2002 ee-c++
1180733 196 -rw-r--r-- 1 roberto roberto 189497 17 gen 2002 ee-c++filt
1180731 340 -rw-r--r-- 1 roberto roberto 338613 17 gen 2002 ee-cpp
1180734 1904 -rw-r--r-- 1 roberto roberto 1941389 17 gen 2002 ee-dvp-as
1180735 252 -rw-r--r-- 1 roberto roberto 247291 17 gen 2002 ee-dvp-gasp
1180739 340 -rw-r--r-- 1 roberto roberto 337854 17 gen 2002 ee-g++
1180736 252 -rw-r--r-- 1 roberto roberto 247883 17 gen 2002 ee-gasp
1180737 336 -rw-r--r-- 1 roberto roberto 333402 17 gen 2002 ee-gcc
1180738 9304 -rw-r--r-- 1 roberto roberto 9505921 17 gen 2002 ee-gdb
1180740 1800 -rw-r--r-- 1 roberto roberto 1833080 17 gen 2002 ee-ld
1180741 1376 -rw-r--r-- 1 roberto roberto 1398719 17 gen 2002 ee-nm
1180742 1812 -rw-r--r-- 1 roberto roberto 1846576 17 gen 2002 ee-objcopy
1180743 2044 -rw-r--r-- 1 roberto roberto 2081848 17 gen 2002 ee-objdump
1180744 1300 -rw-r--r-- 1 roberto roberto 1319347 17 gen 2002 ee-ranlib
1180745 444 -rw-r--r-- 1 roberto roberto 443420 17 gen 2002 ee-readelf
1180746 1228 -rw-r--r-- 1 roberto roberto 1248609 17 gen 2002 ee-size
1180748 1228 -rw-r--r-- 1 roberto roberto 1245249 17 gen 2002 ee-strings
1180747 1812 -rw-r--r-- 1 roberto roberto 1846571 17 gen 2002 ee-strip
1180749 1480 -rw-r--r-- 1 roberto roberto 1506913 17 gen 2002 expect
1180750 312 -rw-r--r-- 1 roberto roberto 307227 17 gen 2002 flex
1180751 312 -rw-r--r-- 1 roberto roberto 307227 17 gen 2002 flex++
1180752 20 -rw-r--r-- 1 roberto roberto 15135 17 gen 2002 gccbug
1180753 184 -rw-r--r-- 1 roberto roberto 176369 17 gen 2002 gcov
1180754 8 -rw-r--r-- 1 roberto roberto 2693 17 gen 2002 install-sid
1180755 1384 -rw-r--r-- 1 roberto roberto 1406330 17 gen 2002 itclsh3.0
1180756 3164 -rw-r--r-- 1 roberto roberto 3230017 17 gen 2002 itkwish3.0
1180757 396 -rw-r--r-- 1 roberto roberto 396367 17 gen 2002 make
1180758 212 -rw-r--r-- 1 roberto roberto 204937 17 gen 2002 patch
1180759 8 -rw-r--r-- 1 roberto roberto 3002 17 gen 2002 runtest
1180760 88 -rw-r--r-- 1 roberto roberto 80453 17 gen 2002 sdiff
1180761 20 -rw-r--r-- 1 roberto roberto 14672 17 gen 2002 send-pr
1180762 1160 -rw-r--r-- 1 roberto roberto 1176141 17 gen 2002 tclsh
1180763 8 -rw-r--r-- 1 roberto roberto 2187 17 gen 2002 tixindex
1180764 3556 -rw-r--r-- 1 roberto roberto 3629224 17 gen 2002 tixwish4.1.8.0
1180765 2820 -rw-r--r-- 1 roberto roberto 2877422 17 gen 2002 wish
chmod u+x -R /usr/local/sce
I ran both commands:
1) chmod u+x -R /usr/local/sce
2) # Location of Compilers and Utilities
export PATH=$PATH:/usr/local/sce/bin:/usr/local/sce/ee/gcc/bin:/usr/local/sce/iop/gcc/bin
# Hostname or IP Address of PS2 TOOL
export DSNETM=ps2tool
now what do I do to start from an example in the / ee?
1) chmod u+x -R /usr/local/sce
2) # Location of Compilers and Utilities
export PATH=$PATH:/usr/local/sce/bin:/usr/local/sce/ee/gcc/bin:/usr/local/sce/iop/gcc/bin
# Hostname or IP Address of PS2 TOOL
export DSNETM=ps2tool
now what do I do to start from an example in the / ee?
Original thread: https://assemblergames.com/threads/program-to-create-files-elf-in-linux.36737/