Je suis Charlie

Autres trucs

Accueil

Seulement les RFC

Seulement les fiches de lecture

Mon livre « Cyberstructure »

Ève

Ce blog n'a d'autre prétention que de me permettre de mettre à la disposition de tous des petits textes que j'écris. On y parle surtout d'informatique mais d'autres sujets apparaissent parfois.


Freenet, distribution égalitaire de fichiers

Première rédaction de cet article le 27 juin 2000


Freenet est un service radicalement nouveau de distribution de fichiers sur Internet (ou bien sur des réseaux similaires). Il appartient à la catégorie des systèmes d'échange horizontaux, comme Napster ou Gnutella. Comme eux, il brouille la distinction entre client et serveur en permettant à tout nœud Freenet d'échanger des fichiers avec les autres nœuds.

Mais Freenet s'en distingue par le fait qu'il s'agisse d'un logiciel libre (il existe des mises en œuvre libres des protocoles de Napster ou de Gnutella). Et, surtout, son protocole garantit un anonymat complet, aussi bien de l'émetteur d'information que de ses lecteurs.

Freenet permet ainsi de publier des informations impopulaires. Si cela peut sembler inutile dans un pays raisonnablement démocratique, il faut se rappeler que la plupart des pays connectés à l'Internet ne sont pas, et de loin, démocratiques. Mais, surtout, certains organisations (comme l'Église de Scientologie ou comme beaucoup de grosses entreprises) ont le pouvoir de faire interdire pas mal de choses qui les dérangent, partout dans le monde.

Pour atteindre ce but, Freenet utilise un algorithme très astucieux, qui fait que ce système n'est pas intéressant que pour l'émetteur d'informations problématiques. Les passionnés d'algorithmique distribuée seront intéressés également. En deux mots, chaque nœud Freenet ne connait qu'un petit nombre de voisins : il demande un éventuel fichier à chaque voisin, qui le demandent à leurs voisins, etc. Le fichier, s'il est trouvé, suit le chemin inverse. On ne peut donc pas retrouver quel était le vrai demandeur, ni le vrai serveur. (Eh oui, comme avec UUCP.)


L'article seul

My PowerMac 7200 and Linux

First publication of this article on 15 June 2000


My girlfriend bought a second-hand Apple PowerMacintosh 7200 (to congratulate herself for the ebook Conception et animation d'un serveur Web associatif - in French). This was a good opportunity to test Linux on it. Unfortunately, unlike what happens with PC laptops, it seems there is no list of Web servers describing how Jim or Joe had setup their Mac with Linux. So, I've made this page to document how I've installed and configured it. Because of various hardware problems (the 7200 does not recognize modern hard disks and I have various SCSI problems with the old disks), I had to discontinue the experience. I no longer have a Powermac/Linux so don't ask me too many questions.

I did not buy it, someone else did, so I did not check its compatibility with Linux, like you should always do with a new machine. As a second-hand machine, it came with no documentation at all. So, I still do not understand some features. You could find very detailed information about its hardware at http://developer.apple.com/techpubs/hardware/hardware2.html but, like many corporations, Apple deleted it from its site once the machine was "too old". The choice of Linux was because I wanted to try Linux outside of the Intel-*386 world.

The PowerMacintosh 7200 is no longer manufactured by Apple. The CPU is a 120 Mhz PowerPC 601. The hard disk a 500 Mb SCSI. The mouse has only one button, which is a pain for X11. It seems to be Y2K-compliant :-)

Because of a RAM extension, it has 144 Mb of memory. I have an Ethernet card. There is an internal hard disk and two external disks, on the SCSI bus (plus a scanner, which I did not try with Linux yet). The output of program dmesg is included here for more information:

device tree used 14980 bytes
Total memory = 144MB; using 1024kB for hash table (at c0300000)
Linux version 2.2.12-2 (root@chewbacca.terraplex.com) (gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)) #1 Fri Oct 8 18:07:08 MDT 1999
PCI bus 0 controlled by bandit at f2000000
Cache coherency enabled for bandit/PSX at f2000000
System has 32 possible interrupts
Console: colour dummy device 80x25
Calibrating delay loop... 119.19 BogoMIPS
Memory: 142260k available (1556k kernel code, 3496k data, 144k init) [c0000000,c9000000]
DENTRY hash table entries: 262144 (order: 9, 2097152 bytes)
Buffer-cache hash table entries: 262144 (order: 8, 1048576 bytes)
Page-cache hash table entries: 65536 (order: 6, 262144 bytes)
POSIX conformance testing by UNIFIX
PCI: Probing PCI hardware
adb devices: [2]: 2 5 [3]: 3 1
Linux NET4.0 for Linux 2.2
Based upon Swansea University Computer Society NET3.039
NET4: Unix domain sockets 1.0 for Linux NET4.0.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
TCP: Hash tables configured (ehash 262144 bhash 65536)
Starting kswapd v 1.5 
OHCI USB Driver loading
USB HID boot protocol mouse driver registered.
USB Printer support registered.
MacOS display is /platinu
Total VRAM = 1MB 0001
Monitor sense value = 0x60b, using video mode 13 and color mode 0.
Console: switching to colour frame buffer device 104x39
fb0: platinum frame buffer device
ADB keyboard at 2, handler set to 3
ADB mouse at 3, handler set to 2
PowerMac Z8530 serial driver version 1.01
tty00 at 0xf3013020 (irq = 15) is a Z8530 ESCC, port = modem
tty01 at 0xf3013000 (irq = 16) is a Z8530 ESCC, port = printer
pty: 256 Unix98 ptys configured
Macintosh ADB mouse driver installed.
Macintosh non-volatile memory driver v1.0
Sound initialization started
Sound initialization complete
DMA sound driver installed, using 4 buffers of 32k.
RAM disk driver initialized:  16 RAM disks of 4096K size
loop: registered device at major 7
fd0: SWIM3 floppy controller 
scsi0 : 53C94
scsi : 1 host.
USB hub driver registered
  Vendor: QUANTUM   Model: TRB540S           Rev: 0405
  Type:   Direct-Access                      ANSI SCSI revision: 02
Detected scsi disk sda at scsi0, channel 0, id 0, lun 0
  Vendor: UMAX      Model: Astra 610S        Rev: V1.3
  Type:   Scanner                            ANSI SCSI revision: 02
  Vendor: MICROP    Model: 1924-21MZ1077802  Rev: HZ2P
  Type:   Direct-Access                      ANSI SCSI revision: 02
Detected scsi disk sdb at scsi0, channel 0, id 2, lun 0
  Vendor: MATSHITA  Model: CD-ROM CR-8008    Rev: 8.0e
  Type:   CD-ROM                             ANSI SCSI revision: 02
Detected scsi CD-ROM sr0 at scsi0, channel 0, id 3, lun 0
  Vendor: QUANTUM   Model: FIREBALL_TM1280S  Rev: 300N
  Type:   Direct-Access                      ANSI SCSI revision: 02
Detected scsi disk sdc at scsi0, channel 0, id 6, lun 0
scsi : detected 1 SCSI cdrom 3 SCSI disks total.
Uniform CDROM driver Revision: 2.55
SCSI device sda: hdwr sector= 512 bytes. Sectors= 1065235 [520 MB] [0.5 GB]
SCSI device sdb: hdwr sector= 512 bytes. Sectors= 4096656 [2000 MB] [2.0 GB]
SCSI device sdc: hdwr sector= 512 bytes. Sectors= 2503872 [1222 MB] [1.2 GB]
PPP: version 2.3.7 (demand dialling)
TCP compression code copyright 1989 Regents of the University of California
PPP line discipline registered.
eth0: MACE at 00:05:02:88:8d:56, chip revision 25.64

And /proc/pci contains:

PCI devices found:
  Bus  0, device  11, function  0:
    Host bridge: Apple Bandit (rev 3).
      Medium devsel.  Fast back-to-back capable.  Master Capable.  Latency=32.  
  Bus  0, device  16, function  0:
    Hot Swap Controller: Apple Grand Central (rev 2).
      Medium devsel.  Master Capable.  Latency=32.  
      Non-prefetchable 32 bit memory at 0xf3000000 [0xf3000000].

I've choosen Linux for the reasons mentioned before. It could have been NetBSD (although it does not seem supported), but I'm more used to Linux. And I wanted the Debian distribution since it is by far the easiest to manage (specially on the long term, when you install new stuff or upgrade) and because it emphasizes freedom and cooperation (all the other Linux distributions were commercial).

Apart from that, the software is typical of an Unix box. The whole stuff, including monsters like Emacs, X11 and LaTeX, takes 320 megabytes of hard disk.

Before starting the installation, I had to think about a proper partitioning. Two hard disks were already partitioned (with a MacOS partition on each, which is seen with a different number, 4 on one disk and 5 on the other) and filled in. A third disk was completely new, I just had to let one partition for MacOS. Remember that the Macintosh is not mine so I was very careful not to destroy what existed before.

I used the pdisk tool, in its MacOS version, to create Apple_UNIX_SVR2 partitions, the ones which are accepted by Linux. The cfdisk run by the Debian installer is not able to manage MacOS partitioning. The MacOS partition was initialized by Apple's "Drive setup". The Linux partitions were initialized by mke2fs, run from the Debian installer.

There is also a Unix version of pdisk, available as a RPM or as source. But do not use cfdisk (menu "Partition a hard disk") on a disk which MacOS may use.

So, my partitions are not seen by fdisk, but it is a minor annoyance. Here is what pdisk says:

Partition map (with 512 byte blocks) on '/dev/sdb'
 #:                type name             length   base    ( size )
 1: Apple_partition_map Apple                63 @ 1      
 2:      Apple_Driver43*Macintosh            54 @ 64     
 3:      Apple_Driver43*Macintosh            74 @ 118    
 4:       Apple_Patches Patch Partition     512 @ 192    
 5:     Apple_UNIX_SVR2 root            1946257 @ 704     (950.3M)
 6:     Apple_UNIX_SVR2 swap             273301 @ 1946961 (133.4M)
 7:     Apple_UNIX_SVR2 home             423430 @ 2220262 (206.8M)
 8:           Apple_HFS Sans titre 4    1452954 @ 2643692 (709.5M)
 9:          Apple_Free Extra                10 @ 4096646

Device block size=512, Number of Blocks=4096655 (2.0G)
DeviceType=0x0, DeviceId=0x0
Drivers-
1: @ 64 for 21, type=0x1
2: @ 118 for 32, type=0xffff

Since the Debian installer requires the base system to be found somewhere and since the Linux kernel can read HFS (MacOS filesystem), I put base2-2.tgz on a MacOS partition, which I mounted from the installer.

For booting the Linux kernel, in order to use the installer, there are typically several options:

  • On machines with a working OpenFirmware ("newworld", to my knowledge, G3 and G4 but not the 7200), you can boot directly from a Linux floppy, with the yaboot program.
  • With a MacOS tool, which will run at startup or once the Finder is there, BootX. (It plays the same role as loadlin on MS-DOS.) It requires MacOS, which is a political problem (MacOS is not free) but not a practical one (I don't think you can buy a Mac without MacOS, which is a shame, but this is another story).

To be sure I didn't risk to change anything on the MacOS side, I used BootX. I put the Debian kernel in the "Linux Kernels" folder into the System folder, and BootX accepted to start it. For reasons I don't know, the current Debian kernel (a Linux 2.2.12) does not see the SCSI disks of the 7200. So, I used the kernel from LinuxPPC, which, while being the same Linux version, works fine. BootX allows you to have several kernels in "Linux kernels" and to switch at will.

After filling the disk with the things I need, df showed:

Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sdb5               957792    329024    580112  36% /
/dev/sdb7               205018      1940    192493   1% /home
/dev/sdb8               726466     18779    707687   3% /MacOS/gros-truc
/dev/sdc4              1251763    952594    299169  76% /MacOS/Paulo_2
/dev/sda5               532244    165104    367140  31% /MacOS/Disque_interne

One the base system installed, I quit dselect immediately and everything was installed by apt-get. That way, I'm sure I will only get the minimum I wanted and I still benefit from the dependencies management.

At the time of this writing, I use kernel 2.2.12. It is the precompiled kernel from LinuxPPC, I had no time to recompile a kernel, yet (and upgrading a kernel with BootX is unc onvenient, since BootX can only boot from a MacOS partition). Power off when shutting down works fine.

The Ethernet card was recognized automatically. Nothing special. The kernel sees it that way:

eth0: MACE at 00:05:02:88:8d:56, chip revision 25.64

Since there is a running home server on the same local network, I just had to configure sendmail that way, in sendmail.mc:

OSTYPE(debian)dnl
FEATURE(nullclient, `[mail.sources.org]')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(allmasquerade)dnl
FEATURE(use_ct_file)dnl
FEATURE(nouucp)dnl
FEATURE(nodns)dnl
MASQUERADE_AS(sources.org)dnl

The X server for framebuffers (Debian package xserver-fbdev) worked fine, with the XF86config installed by default. My keyboard is a French AZERTY, and I have some problems. The map "mac-fr3" seems fine with the console. The Debian installer refused to change the map (menu "Configuring the keyboard"), saying "This is not a valid binary keymap". Under X11, I still have missing characters, like the |, even when they are fine on the console.

At startup, the X server says:

XFree86 Version 3.3.6 / X Window System
(protocol Version 11, revision 0, vendor release 6300)
...
Operating System: Linux 2.3.10 ppc [ELF] 
Configured drivers:
   FBDev: Server for frame buffer device
   (Patchlevel 11): mfb, afb, cfb8, cfb16, cfb32, NCR 77C32BLT (accel), ATI Mach64 (accel), IMS TwinTurbo (accel), 3Dlabs Permedia 2 (accel)
(using VT number 7)

XF86Config: /usr/X11R6/lib/X11/XF86Config
(**) stands for supplied, (--) stands for probed/default values
(**) XKB: disabled
(**) Mouse: type: BusMouse, device: /dev/mouse, buttons: 3
(**) FBDev: Graphics device ID: "Linux Frame Buffer Device"
(**) FBDev: Monitor ID: "Generic Monitor"
(**) FontPath set to "/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/75dpi/:unscaled,/usr/X11R6/lib/X11/fonts/100dpi/:unscaled,/usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/Speedo/,/usr/X11R6/lib/X11/fonts/75dpi/,/usr/X11R6/lib/X11/fonts/100dpi/"
(**) FBDev: Using default frame buffer video mode
(--) FBDev: Frame buffer device: platinum
(--) FBDev: Video memory: 1024K @ 0xf1000090
(--) FBDev: MMIO regs: 4K @ 0xf8000000
(--) FBDev: Type 0 type_aux 0 bits_per_pixel 8
(--) FBDev: Hardware accelerator: None
(--) FBDev: No driver support for hardware acceleration
bpp = 8, depth = 8, BitsPerRGB = 8
(--) FBDev: Using cfb8 driver

I didn't test the sound.

A few other references:


L'article seul

query-loc: find LOCation information in the DNS

First publication of this article on 10 January 2000
Last update on of 17 July 2009


query-loc is a small C program which can be used to find location information (longitude and latitude) in the DNS, if the network administrator did put this information in the DNS.

An example of use :

$  query-loc  www.internatif.org

This is query-loc, version 0.1.1.

LOCation for www.internatif.org is 48 52 00.000 N 2 20 00.000 E 0.00m 1.00m 1000
0.00m 10.00m

query-loc is distributed with BIND, in the contrib/ directory, as well as from query-loc.tar.gz. If you want to participate to the development, the simplest way is to use git and get the sources at FramaGit.

It uses the algorithms described in RFC 1876 (and RFC 1101 to get the network names).

It is free, under the GPL.

It is written and (not a lot) maintained by Stéphane Bortzmeyer <stephane+query-loc@bortzmeyer.org>.

Thanks to Paul Vixie for the RFC and its encouragements. Thanks to Björn Augustsson for the xtraceroute program, which provided the necessary impulse. Thanks to Roland Dirlewanger for extensive patching.


L'article seul

Articles des différentes années : 2024  2023  2022  2021  2020  2019  2018  Précédentes années

Syndication : Flux Atom avec seulement les résumés et Flux Atom avec tout le contenu.

Un article de ce blog au hasard.