For the curious...

Investigation into how Linux on the PS3 might lead to homebrew development.

Moderators: cheriff, emoon

Post Reply
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

For the curious...

Post by ooPo »

YDL 5.0 on a 20GB PS3:

Code: Select all

[root@localhost sys]# cat /proc/cpuinfo 
processor       : 0
cpu             : Cell Broadband Engine, altivec supported
clock           : 3192.000000MHz
revision        : 5.1 (pvr 0070 0501)

processor       : 1
cpu             : Cell Broadband Engine, altivec supported
clock           : 3192.000000MHz
revision        : 5.1 (pvr 0070 0501)

timebase        : 79800000
machine         : PS3PF

Code: Select all

[root@localhost sys]# dmesg 
as_initialize():
  page_sizes 0x1810000000000000
  number_of_page_sizes 2
  size_at_least        20
  lv1_construct_virtual_address_space() status 0
  virtual_address_space_id 0xb
  actual_size 0x100000
ps3pf_rm_limit=134217728, ps3pf_mem_total=234881024
ps3pf_2nd_mem_base=00006c0060000000, ps3pf_2nd_mem_size=100663296
lmb.rmo_size = 234881024
spu[0]: lspu_id=0c pb=00004c00006c0000 p1=000030000000e000 p2=00004c00006e0000
spu[1]: lspu_id=13 pb=00004c00007c0000 p1=0000300000010000 p2=00004c00007e0000
spu[2]: lspu_id=17 pb=00004c00008c0000 p1=0000300000012000 p2=00004c00008e0000
spu[3]: lspu_id=1b pb=00004c00009c0000 p1=0000300000014000 p2=00004c00009e0000
spu[4]: lspu_id=1f pb=00004c0000ac0000 p1=0000300000016000 p2=00004c0000ae0000
spu[5]: lspu_id=23 pb=00004c0000bc0000 p1=0000300000018000 p2=00004c0000be0000
Page orders: linear mapping = 24, others = 12
Found initrd at 0xc00000000300b000:0xc0000000030f5000
Starting Linux PPC64 #1 SMP Fri Nov 24 16:16:29 EST 2006
-----------------------------------------------------
ppc64_pft_size                = 0x14
ppc64_interrupt_controller    = 0x1
platform                      = 0x801
physicalMemorySize            = 0xe000000
ppc64_caches.dcache_line_size = 0x80
ppc64_caches.icache_line_size = 0x80
htab_address                  = 0x0000000000000000
htab_hash_mask                = 0x1fff
-----------------------------------------------------
*** 0000 : CF000100

*** 0000 : MM Init
[boot]0100 MM Init
*** 0000 : CF000100

*** 0000 : MM Init Done
[boot]0100 MM Init Done
Linux version 2.6.16-20061110.ydl.1ps3 (root@m157) (gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)) #1 SMP Fri Nov 24 16:16:29 EST 2006
*** 0000 : CF000012

*** 0000 : Setup Arch
[boot]0012 Setup Arch
Top of RAM: 0xe000000, Total RAM: 0xe000000
Memory hole size: 0MB
On node 0 totalpages: 57344
  DMA zone: 57344 pages, LIFO batch:15
  DMA32 zone: 0 pages, LIFO batch:0
  Normal zone: 0 pages, LIFO batch:0
  HighMem zone: 0 pages, LIFO batch:0
*** 0000 : CF000015

*** 0000 : Setup Done
[boot]0015 Setup Done
Built 1 zonelists
Kernel command line: root=/dev/sda1 init=/sbin/init video=ps3fb:mode:5 rhgb 
PID hash table entries: 1024 (order: 10, 32768 bytes)
ps3pf_calibrate_decr: decrementer frequency = 79.800000 MHz
ps3pf_calibrate_decr: processor frequency   = 3192.000000 MHz
time_init: decrementer frequency = 79.800000 MHz
time_init: processor frequency   = 3192.000000 MHz
Console: colour dummy device 80x25
Dentry cache hash table entries: 32768 (order: 6, 262144 bytes)
Inode-cache hash table entries: 16384 (order: 5, 131072 bytes)
Memory: 199392k/229376k available (3920k kernel code, 29636k reserved, 832k data, 20035k bss, 212k init)
Calibrating delay loop... 158.72 BogoMIPS (lpj=317440)
Mount-cache hash table entries: 256
Processor 1 found.
Brought up 2 CPUs
migration_cost=622
checking if image is initramfs... it is
Freeing initrd memory: 936k freed
NET: Registered protocol family 16
PCI: Probing PCI hardware
PCI: Probing PCI hardware done
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
VUART: initialize
SYSMGR: sysmgr_init() called
Squashfs 2.2-r2 (released 2005/09/08) (C) 2002-2005 Phillip Lougher
Installing knfsd (copyright (C) 1996 [email protected]).
fuse init (API version 7.6)
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 211x60
fb0: GPU frame buffer device, using 18432K of video memory
Generic RTC Driver v1.07
isa bounce pool size: 16 pages
RAMDISK driver initialized: 16 RAM disks of 10240K size 1024 blocksize
loop: loaded (max 8 devices)
..........
ps3pf_stor: dev=1 type=e port=0 regions=7 accessible=1
ps3pf_stor: dev=2 type=0 port=2 regions=4 accessible=1
ps3pf_stor: dev=3 type=5 port=0 regions=1 accessible=1
scsi0 : ps3pf
  Vendor: SONY      Model: PS-SYSTEM   302R  Rev: 4062
  Type:   CD-ROM                             ANSI SCSI revision: 00
scsi1 : ps3pf
  Vendor: SCEI      Model: Sec:Master-3      Rev: 4989
  Type:   Direct-Access                      ANSI SCSI revision: 02
scsi2 : ps3pf
  Vendor: SCEI      Model: Flash-5           Rev: 4989
  Type:   Direct-Access-RBC                  ANSI SCSI revision: 02
e100: Intel(R) PRO/100 Network Driver, 3.5.10-k2-NAPI
e100: Copyright(c) 1999-2005 Intel Corporation
tun: Universal TUN/TAP device driver, 1.6
tun&#58; &#40;C&#41; 1999-2004 Max Krasnyansky <[email protected]>
Uniform Multi-Platform E-IDE driver Revision&#58; 7.00alpha2
ide&#58; Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
SCSI device sda&#58; 20971512 512-byte hdwr sectors &#40;10737 MB&#41;
sda&#58; Write Protect is off
sda&#58; Mode Sense&#58; 00 18 00 00
SCSI device sda&#58; drive cache&#58; write back
SCSI device sda&#58; 20971512 512-byte hdwr sectors &#40;10737 MB&#41;
sda&#58; Write Protect is off
sda&#58; Mode Sense&#58; 00 18 00 00
SCSI device sda&#58; drive cache&#58; write back
 sda&#58; sda1 sda2
sd 1&#58;0&#58;0&#58;0&#58; Attached scsi disk sda
SCSI device sdb&#58; 8192 512-byte hdwr sectors &#40;4 MB&#41;
sdb&#58; Write Protect is off
sdb&#58; Mode Sense&#58; 00 18 0e 00
SCSI device sdb&#58; drive cache&#58; write through
SCSI device sdb&#58; 8192 512-byte hdwr sectors &#40;4 MB&#41;
sdb&#58; Write Protect is off
sdb&#58; Mode Sense&#58; 00 18 0e 00
SCSI device sdb&#58; drive cache&#58; write through
 sdb&#58; unknown partition table
sd 2&#58;0&#58;0&#58;0&#58; Attached scsi disk sdb
sr0&#58; scsi3-mmc drive&#58; 62x/62x cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision&#58; 3.20
sr 0&#58;0&#58;0&#58;0&#58; Attached scsi CD-ROM sr0
sr 0&#58;0&#58;0&#58;0&#58; Attached scsi generic sg0 type 5
sd 1&#58;0&#58;0&#58;0&#58; Attached scsi generic sg1 type 0
sd 2&#58;0&#58;0&#58;0&#58; Attached scsi generic sg2 type 14
PCI&#58; Enabling device&#58; &#40;0000&#58;00&#58;01.1&#41;, cmd 2
ehci_hcd 0000&#58;00&#58;01.1&#58; EHCI Host Controller
ehci_hcd 0000&#58;00&#58;01.1&#58; new USB bus registered, assigned bus number 1
ehci_hcd 0000&#58;00&#58;01.1&#58; irq 10, io mem 0x4000001b0000
ehci_hcd 0000&#58;00&#58;01.1&#58; USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1&#58; configuration #1 chosen from 1 choice
hub 1-0&#58;1.0&#58; USB hub found
hub 1-0&#58;1.0&#58; 2 ports detected
PCI&#58; Enabling device&#58; &#40;0000&#58;00&#58;02.1&#41;, cmd 2
ehci_hcd 0000&#58;00&#58;02.1&#58; EHCI Host Controller
ehci_hcd 0000&#58;00&#58;02.1&#58; new USB bus registered, assigned bus number 2
ehci_hcd 0000&#58;00&#58;02.1&#58; irq 11, io mem 0x4000001d0000
ehci_hcd 0000&#58;00&#58;02.1&#58; USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb2&#58; configuration #1 chosen from 1 choice
hub 2-0&#58;1.0&#58; USB hub found
hub 2-0&#58;1.0&#58; 2 ports detected
ohci_hcd&#58; 2005 April 22 USB 1.1 'Open' Host Controller &#40;OHCI&#41; Driver &#40;PCI&#41;
PCI&#58; Enabling device&#58; &#40;0000&#58;00&#58;01.0&#41;, cmd 2
ohci_hcd 0000&#58;00&#58;01.0&#58; OHCI Host Controller
ohci_hcd 0000&#58;00&#58;01.0&#58; new USB bus registered, assigned bus number 3
ohci_hcd 0000&#58;00&#58;01.0&#58; irq 16, io mem 0x4000001a0000
usb usb3&#58; configuration #1 chosen from 1 choice
hub 3-0&#58;1.0&#58; USB hub found
hub 3-0&#58;1.0&#58; 2 ports detected
usb 1-2&#58; new high speed USB device using ehci_hcd and address 2
PCI&#58; Enabling device&#58; &#40;0000&#58;00&#58;02.0&#41;, cmd 2
ohci_hcd 0000&#58;00&#58;02.0&#58; OHCI Host Controller
ohci_hcd 0000&#58;00&#58;02.0&#58; new USB bus registered, assigned bus number 4
ohci_hcd 0000&#58;00&#58;02.0&#58; irq 17, io mem 0x4000001c0000
usb 1-2&#58; configuration #1 chosen from 1 choice
hub 1-2&#58;1.0&#58; USB hub found
hub 1-2&#58;1.0&#58; 4 ports detected
usb usb4&#58; configuration #1 chosen from 1 choice
hub 4-0&#58;1.0&#58; USB hub found
hub 4-0&#58;1.0&#58; 2 ports detected
Initializing USB Mass Storage driver...
usb 2-2&#58; new high speed USB device using ehci_hcd and address 2
usb 2-2&#58; configuration #1 chosen from 1 choice
usb 1-2.2&#58; new full speed USB device using ehci_hcd and address 3
usb 1-2.2&#58; configuration #1 chosen from 1 choice
usb 1-2.4&#58; new full speed USB device using ehci_hcd and address 4
usb 1-2.4&#58; configuration #1 chosen from 1 choice
usbcore&#58; registered new driver usb-storage
USB Mass Storage support registered.
usbcore&#58; registered new driver hiddev
input&#58; Logitech USB Receiver as /class/input/input0
input&#58; USB HID v1.11 Keyboard &#91;Logitech USB Receiver&#93; on usb-0000&#58;00&#58;01.1-2.2
input&#58; Logitech USB Receiver as /class/input/input1
input,hiddev96&#58; USB HID v1.11 Mouse &#91;Logitech USB Receiver&#93; on usb-0000&#58;00&#58;01.1-2.2
input&#58; Sony PLAYSTATION&#40;R&#41;3 Controller as /class/input/input2
input&#58; USB HID v1.11 Joystick &#91;Sony PLAYSTATION&#40;R&#41;3 Controller&#93; on usb-0000&#58;00&#58;01.1-2.4
usbcore&#58; registered new driver usbhid
drivers/usb/input/hid-core.c&#58; v2.6&#58;USB HID core driver
mice&#58; PS/2 mouse device common for all mice
NET&#58; Registered protocol family 2
IP route cache hash table entries&#58; 2048 &#40;order&#58; 2, 16384 bytes&#41;
TCP established hash table entries&#58; 8192 &#40;order&#58; 5, 131072 bytes&#41;
TCP bind hash table entries&#58; 8192 &#40;order&#58; 5, 131072 bytes&#41;
TCP&#58; Hash tables configured &#40;established 8192 bind 8192&#41;
TCP reno registered
TCP bic registered
NET&#58; Registered protocol family 1
NET&#58; Registered protocol family 17
Freeing unused kernel memory&#58; 212k freed
kjournald starting.  Commit interval 5 seconds
EXT3-fs&#58; mounted filesystem with ordered data mode.
Bluetooth&#58; Core ver 2.8
NET&#58; Registered protocol family 31
Bluetooth&#58; HCI device and connection manager initialized
Bluetooth&#58; HCI socket layer initialized
Bluetooth&#58; HCI USB driver ver 2.9
usbcore&#58; registered new driver hci_usb
PS3PF sound started. start_delay=2000ms
eth0&#58; Gelic Network Driver
eth0&#58; Ethernet Address&#58; 00&#58;15&#58;C1&#58;C8&#58;B2&#58;F9
ps3fb&#58; mmap framebuffer P&#40;670000&#41;->V&#40;f6dce000&#41;
EXT3 FS on sda1, internal journal
Adding 2096472k swap on /dev/sda2.  Priority&#58;-1 extents&#58;1 across&#58;2096472k
ip_tables&#58; &#40;C&#41; 2000-2006 Netfilter Core Team
ip_conntrack version 2.4 &#40;896 buckets, 7168 max&#41; - 288 bytes per conntrack
Bluetooth&#58; L2CAP ver 2.8
Bluetooth&#58; L2CAP socket layer initialized
hci_cmd_task&#58; hci0 command tx timeout
Bluetooth&#58; RFCOMM socket layer initialized
Bluetooth&#58; RFCOMM TTY layer initialized
Bluetooth&#58; RFCOMM ver 1.7
Bluetooth&#58; HIDP &#40;Human Interface Emulation&#41; ver 1.1
ioctl32&#40;hald-probe-hidd&#58;2993&#41;&#58; Unknown cmd fd&#40;4&#41; cmd&#40;41004806&#41;&#123;01&#125; arg&#40;ffe5f85c&#41; on /dev/hiddev0
ps3fb&#58; mmap framebuffer P&#40;670000&#41;->V&#40;f6dce000&#41;

Code: Select all

&#91;root@localhost sys&#93;# lspci
00&#58;01.0 USB Controller&#58; Toshiba America Unknown device 01b6 &#40;rev 01&#41;
00&#58;01.1 USB Controller&#58; Toshiba America Unknown device 01b5 &#40;rev 01&#41;
00&#58;02.0 USB Controller&#58; Toshiba America Unknown device 01b6 &#40;rev 01&#41;
00&#58;02.1 USB Controller&#58; Toshiba America Unknown device 01b5 &#40;rev 01&#41;

Code: Select all

&#91;root@localhost sys&#93;# lsmod
Module                  Size  Used by
hidp                   22136  2 
rfcomm                 57648  0 
l2cap                  34864  10 hidp,rfcomm
ip_conntrack_netbios_ns     3920  0 
ipt_REJECT              7056  1 
xt_state                3432  2 
ip_conntrack           68552  2 ip_conntrack_netbios_ns,xt_state
xt_tcpudp               5424  4 
iptable_filter          5384  1 
ip_tables              17936  1 iptable_filter
x_tables               17568  4 ipt_REJECT,xt_state,xt_tcpudp,ip_tables
spufs                  72704  1 
gelic_net              23840  0 
snd_ps3pf              22680  0 
snd_seq_dummy           5964  0 
snd_seq_oss            59464  0 
snd_seq_midi_event     10528  1 snd_seq_oss
snd_seq                92232  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_seq_device         12440  3 snd_seq_dummy,snd_seq_oss,snd_seq
snd_pcm_oss            78088  0 
snd_mixer_oss          27216  1 snd_pcm_oss
snd_pcm               129092  2 snd_ps3pf,snd_pcm_oss
snd_page_alloc         14184  1 snd_pcm
snd_timer              34680  2 snd_seq,snd_pcm
snd                    87144  8 snd_ps3pf,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
soundcore              12640  1 snd
joydev                 14936  0 
evdev                  14328  2 
hci_usb                17900  2 
bluetooth              71788  8 hidp,rfcomm,l2cap,hci_usb

Code: Select all

&#91;root@localhost sys&#93;# uname -a
Linux localhost.localdomain 2.6.16-20061110.ydl.1ps3 #1 SMP Fri Nov 24 16&#58;16&#58;29 EST 2006 ppc64 ppc64 ppc64 GNU/Linux

Code: Select all

&#91;root@localhost proc&#93;# free
             total       used       free     shared    buffers     cached
Mem&#58;        200888     186220      14668          0       6192      83296
-/+ buffers/cache&#58;      96732     104156
Swap&#58;      2096472        108    2096364

Code: Select all

&#91;root@localhost proc&#93;# cat /proc/meminfo 
MemTotal&#58;       200888 kB
MemFree&#58;         14668 kB
Buffers&#58;          6200 kB
Cached&#58;          83288 kB
SwapCached&#58;          0 kB
Active&#58;         121204 kB
Inactive&#58;        37168 kB
HighTotal&#58;           0 kB
HighFree&#58;            0 kB
LowTotal&#58;       200888 kB
LowFree&#58;         14668 kB
SwapTotal&#58;     2096472 kB
SwapFree&#58;      2096364 kB
Dirty&#58;              52 kB
Writeback&#58;           0 kB
Mapped&#58;         103780 kB
Slab&#58;            22740 kB
CommitLimit&#58;   2196916 kB
Committed_AS&#58;   141868 kB
PageTables&#58;       2732 kB
VmallocTotal&#58; 8589934592 kB
VmallocUsed&#58;      2324 kB
VmallocChunk&#58; 8589932156 kB
wulf
Posts: 81
Joined: Wed Apr 13, 2005 6:56 pm

Post by wulf »

sweet, thanks, oopo!
Herben
Posts: 107
Joined: Sun Jan 25, 2004 10:25 am

Post by Herben »

I see you use 1080p, does that work out well for you? I have a hard time reading text at that res though I like the extra screen space. ;P
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

I'm using a pc monitor with hdcp, so its very sharp. No problems at all.
panda21
Posts: 2
Joined: Wed Feb 21, 2007 2:54 am

Post by panda21 »

Am I right in thinking that the first section means the PS3 has a dual core PPC main processor where each core is 3ghz?

I have Gentoo on my 60gb PS3 and tried some of the benchmarks from the computer language shootout page on it.

I know these are just benchmarks, they'll only be using one core, and they aren't optimized to run on the SPU's etc, but running pidigits in python, and spectral norm in C on my OS X 1.5ghz G4 powerbook comes out pretty much the same speed as in Gentoo on my PS3.

Surely they should be faster if theyre running on a 3ghz processor? Are the PS3 main processors significantly different from a mac ppc processor?
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

panda21 wrote:Am I right in thinking that the first section means the PS3 has a dual core PPC main processor where each core is 3ghz?
Not actual dual-core, it's SMT, like Hyperthreading on Intel CPUs.
User avatar
wich
Posts: 13
Joined: Wed Feb 14, 2007 6:05 am

Post by wich »

The PPC core in the CBE is very very different from the PPC in a Mac. The most important difference is that the PPC core in the CBE does not have an instruction window and only very limited bracnh prediction.

The instruction window of a processor looks at the the next n instructions to be executed and reorders them in order to take maximum advantage of parallelisation of instructions on the various processing units in the core. In short a properly functioning instruction window can greatly increase the number of instructions executed per clock cycle. The penalty however is that the instruction window takes up much die real estate, which in the case of the CBE is spent on the SPEs instead. The rationalization for this is that the proper reordering of instruction can also be done in the compiler, but this of course means that the compiler should have an intimate knowledge of the processors internal workings to determine the proper order of instructions. Given however that the CBE is a specialized processor, and not bound to any previously defined computing platform this isn't much of an issue beyond the actual effor to realise such a compiler.

The branch prediction is a very complicated piece of kit in most modern processors. It's task is to predict which code branch will be taken well before the actual branch instruction is executed. The reason for this is that when the prediction is wrong, the processor has to clear the entire instruction pipeline and restart processing with the branch actually taken. Given that these days instruction pipelines are getting very long, such a branch miss will incur numerous wasted processor cycles which the processor needs to refill the instruction pipeline. Again though the branch prediction takes up a lot of die real estate which in the case of the CBE is contributed to the SPEs instead. Again the rationalisation here is that the compiler can hint the processor which branch will be taken in an upcoming branch instruction by inserting branch hints in the instruction stream.

In the end all of this means that code generated by a run of the mill compiler will run far more inefficiently on the CBE's PPC core than on a G4 or G5 PPC. In order to use the true processing power of the CBE you need a specialised compiler.

There are quite a few more differences, but these are the most important ones in this respect.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

wich wrote:The PPC core in the CBE is very very different from the PPC in a Mac. The most important difference is that the PPC core in the CBE does not have an instruction window and only very limited bracnh prediction.
You should qualify that - it's very different from the PPC in RECENT Macs. It's pretty much the same as the PPC in older PowerMacs. It's VERY similar to a PPC 603 or 604 (other than having 64bit support). The same kinds of instruction ordering you would do for the 603/604 would be done with the CBE.
panda21
Posts: 2
Joined: Wed Feb 21, 2007 2:54 am

Post by panda21 »

thanks thats a really good explanation, i thought it might be something like that. hopefully there'll be better compilers for it eventually!
User avatar
wich
Posts: 13
Joined: Wed Feb 14, 2007 6:05 am

Post by wich »

You are right in saying that older PPC processors also did not have very complicated instruction windows and branch predicition, but the rest of the core is very much modelled after more recent PPCs.

People interested in these kinds of things should read the Ars Technica articles on the Emotion Engine, the CBE and the Xenon CPU, they are very interesting reading material.
Post Reply