lunedì 20 dicembre 2010

Eclipse: what a pain to build

I was trying to build eclipse from sources, but I didn't find any detailed instruction. Then, someone pointed me to [1], where I found the ppc binaries, and the sources, and detailed instruction :)

Thank you  !


[1] http://download.eclipse.org/eclipse/downloads/drops/R-3.6.1-201009090800/index.php

sabato 11 dicembre 2010

Unsupported relocation against r0

Today I'm building mono-2.8 for ArchlinuxPPC, and I get this error from the assembler:

{standard input}: Assembler messages:
{standard input}:26505: Error: unsupported relocation against r0
make: *** [libmonoruntimesgen_la-sgen-gc.lo] Error 1

The solution is modifying CFLAGS:
export CFLAGS="$CFLAGS -Xassembler -mregnames" 

Have a nice day

lunedì 25 ottobre 2010

mercoledì 22 settembre 2010

I froci: sfatiamo miti come se piovessero sodomiti

http://www.lamentazioni.org/blog/2010/09/i-froci-sfatiamo-miti-come-se-piovessero-sodomiti.prcd

Quand'e' che partiamo?

lunedì 20 settembre 2010

ArchLinuxPPC: The Most Advanced PPC distro in the world

Hello all,

Do you ever know what PowerPC are?
They're great processors made by IBM, which was the core of old Macintosh, and the core of some of the new-generation console, as Nintendo Wii or Playstation 3.

Linux supports powerpc, and this support continue to grow, because big IBM mainframe are all made by many PowerPC CPUs.
So, what is the most advanced linux distro for PowerPC? ArchLinuxPPC!
We provide the last GNOME 2.30.2, KDE 4.5.1, XFCE 4.6.3, the lastest Xorg 1.9, and kernel 2.6.35.4.

Join now our community, and long live PPC!

domenica 5 settembre 2010

undefined reference to `__libc_csu_fini'

After compiling glibc, I had this error when I try to compile other programs:

crt1.o: In function `_start':
(.text+0xc): undefined reference to `__libc_csu_fini'

It is caused by a bad strip of glibc libraries. Please, make sure you don't strip anything (or use --strip-debug) when compiling glibc :)

venerdì 16 luglio 2010

Heap Corruption

,-----------------------------------------------------------------.

| Heap Corruption / A Short Description and Step-by-Step Tutorial |
|         Costantino Pistagna - pistagna@dmi.unict.it             |

'-----------------------------------------------------------------'


Abstract



Cosa e` lo Heap?
La memoria allocata dal processo in fase di runtime -esecuzione-, fa' parte
della struttura che comunemente va' sotto il nome di Heap. Con il termine Heap,
quindi, si intende qualunque forma e porzione di memoria che viene creata
dinamicamente durante l'esecuzione del nostro processo. Un array di caratteri,
allocato dinamicamente attraverso una chiamata malloc/calloc fara' parte dello
heap. In generale qualunque assegnazione dinamica di memoria contigua fara'
parte dello heap. Viceversa, quando la porzione di memoria non e' piu' utile,
viene chiamata una funzione antitetica alla malloc: free().

PowerPC bof howto

,-----------------------------------------------.
| PPC - Buffer Overflow / What you need to know |
| Costantino Pistagna  -  pistagna@dmi.unict.it |
'-----------------------------------------------'


Abstract
Gli attacchi di tipo bof (BufferOverflow) sono una pratica relativamente facile
da implementare. Sulle architetture convenzionali, quali ad esempio intel x86,
il lavoro e' reso ancora piu' facile dal fatto che le chiamate a funzioni sono
implementate con l'opcode "call", il quale salva l'indirizzo del chiamante
sullo stack in maniera da poterlo ripristinare alla fine della funzione
chiamata. Discorso a parte deve essere fatto con architetture alternative,quali
ad esempio PPC e Sparc, per queste deve essere utilizzata una tecnica
alternativa per potere forzare lo stack dal momento che sono presenti ostacoli
di tipo logistico differenti.


giovedì 15 luglio 2010

Lightspark: YUV420 to YUV0 explained

Theory

Lightspark is a free, open source flash player which aims to be a good, lightweight and fast friend for all flash's sites.
It uses SSE2 extension to to a special job, which is transform from planar YUV420 to packet YUV0. 

  • Planar YUV: each component (Y, U, V) is stored as a separate array
  • Packed YUV: Y, U (Cb) and V (Cr) samples are packed together into macropixels which are stored in a single array

So, what's the 420 and the 0 stands for? 

  • 420: For each U and V sample, there are two Y.
  • 0: After The YUV, there is a NULL byte of padding.

Now, there is the signature of the function:

void fun (uint8_t* y, uint8_t* u, uint8_t* v, uint8_t* out, uint32_t width, uint32_t height);

The u and v array are width*height, and the y array is 4 times width*height (there are two samples of Y for each U and V.. remember).

Naming the Y buffer in this way:

Y1, Y2, Y3... (each Y is one byte)

and V and U respectively

V1,V2.... and U1,U2.... (same, each U or V are one byte)

Our out array needs to be (and this is the YUV0 stands for):

Y1U1V1[0]   Y2U1V1[0]   Y3U2V2[0]   Y4U2V2[0].....

Y7U1V1[0]   Y8U1V1[0]   Y9U2V2[0]   Y10U2V2[0].....

And we need to get this for every line.

A graphical explanation of this: http://en.wikipedia.org/wiki/YUV#Y.27UV420p_.28and_Y.27V12.29

Next we'll see an implementation on altivec-capable processors.

mercoledì 14 luglio 2010

aTi 9600 and linux >= 2.6.33.4: a successfull story

I was tired, because with my Radeon I could get only 100 FPS. I'm on a PowerBook, so I tried OSX and I reached ~1500 FPS.

What a mess..

My system:
kernel 2.6.33.4, 2.6.35-rc4 to test
xorg 1.8.1
xf86-video-ati 6.13.0
ati-dri 7.8.1
mesa 7.8.1

lunedì 7 giugno 2010

Perl: using script anywhere in your filesystem

How many times, writing perl script, you have seen this ugly message:

[danimoth@jim test]$ ./TestFileGetCmd.pl
Can't locate FileGetCmd.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.10.1 /usr/share/perl5/site_perl/5.10.1 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl /usr/lib/perl5/current /usr/lib/perl5/site_perl/current .) at ./TestFileGetCmd.pl line 5.
BEGIN failed--compilation aborted at ./TestFileGetCmd.pl line 5.
...

To remove this, you could simply add at the beginning of the script:

use lib 'your_dir';

..and you're OK.

Note that 'your_dir' is relative (so, don't use ../../ or similar if you expect your script is executed from various filesystem's point but instead use absolute path).

If you're sure your scripts will be executed from a specified dir, you could safely use "..".

HTH,

mercoledì 24 febbraio 2010

Scaling bug.. in tutti i software per la grafica

A causa di una errata gestione della gamma della luminosita' (quando si resiza e' trattata linearmente, mentre quando si mostra a video e' trattata esponenzialmente) quasi tutti i software di grafica soffrono di un problema: Quando effettuiamo un resize, e' sbagliato. Ma sbagliato nel senso che l'immagine di partenza e' diversa da quella risultante, sono proprio due immagini differenti.
In realta', non c'e' in tutti i software: qui [ Tux paint ] e' assente. Quando un programma per bambini supera Photoshop CS4, e' ora di dichiarare guerra ai software proprietari.

La spiegazione, comprensiva di molti esempi, e' qui.


Buona lettura

mercoledì 17 febbraio 2010

OpenOffice.org 3.2.0 OSX (ppc)

Very good start for many of us that has a mac ppc and want to try the new openoffice 3.2.0. A great "not found page" is here for us.

Many thanks mother Sun! You could share the scripts used for compiling it. Ehm.. compiling? No, no, I don't have a day to waste.


So, I need to found an alternative way.. and there is :)

  • Download the 3.2.0 for PPC deutch version (here)
  • Drag the applications on Desktop
  • Download the 3.2.0 language pack for OSX Intel (here is en_US)
  • Launch the installer of the language pack, and select the OpenOffice.app that you have on Desktop
  • When finish, you should have OO.org localized. I have en_US as system language, so at first run it was already in english.
How it works? Simply, localization files are architecture-independent. I don't know why reference these as "Intel only", but the fact are these.

Want a linux-ppc version? Install archlinuxPPC and run

pacman -Sy openoffice-base

Have a nice day

sabato 23 gennaio 2010

Scattered file

Ci sono molti modi per scrivere un file, e una buona parte di essi si basa su dd.
Con dd possiamo manipolare molteplici informazioni: lunghezza, dimensione,
numero di blocchi..
Insomma, e' un tool dalle mille potenzialita'.
Una di esse e' la possibilita' di creare "scattered" (sparpagliato, rado) file,
cioe' un file di dimensione definita X, ma di dimensione reale Y.
Ovviamente, la X sara' sempre maggiore di Y.

dd if=/dev/zero of=/dir/file bs=1 count=1 seek=300M

Ho un file lungo 300M di cui solo 1 byte è scritto e il resto non viene allocato sul disco
$ ls -lh mostra la dimensione del file (-h=human readable)

-rw-r--r-- 1 riccardo riccardo 301M 2010-01-05 11:52/dir/file

$ ls -lhs mostra l'occupazione del file su disco (parametro -s)
12K -rw-r--r-- 1 riccardo riccardo 301M 2005-05-05 11:52 /dir/file

Utilita' ? La creazione di immagini per filesystem che si "auto-espandono" (riempono cioe' lo spazio loro assegnatogli) pian piano che si inseriscono dati.

giovedì 14 gennaio 2010

Condividere stampanti tra Linux e OSX

In quanti di voi hanno una stampante su una linuxbox, e usate CUPS per gestirla? In molti, credo.
In quanti di voi, oltre alla suddetta linuxbox, hanno anche un computer con OS X sopra? Un po' di meno, immagino.

Beh, per quelli di voi che hanno quanto ho appena elencato, c'e' un modo (ovviamente) per usare da OSX la stampante attaccata sulla linuxbox, ma non e' (come al solito) intuitivo fare il setup.

I passi sono i seguenti:
  • Aprire Preferenze di sistema
  • Stampanti e fax
  • Aggiungere una stampante
  • Cliccare +, per aggiungerla
  • Andare su IP

La finestra e' simile a questa:


In protocollo mettere IPP, l'indirizzo e' quello della linux box nella forma http://linux-box:631, e in queue ci va (non intuitivamente) printers/nome-stampante .

Scegliete il nome, e come Driver usare il driver Postscript generico.
Fatto questo, Cliccate su aggiungi e dovreste avere una nuova stampante disponibile. Provate ora a lanciare una stampa di prova...