diff options
Diffstat (limited to 'open_issues/64-bit_port.mdwn')
-rw-r--r-- | open_issues/64-bit_port.mdwn | 225 |
1 files changed, 155 insertions, 70 deletions
diff --git a/open_issues/64-bit_port.mdwn b/open_issues/64-bit_port.mdwn index d4bfb4a3..aa49e64b 100644 --- a/open_issues/64-bit_port.mdwn +++ b/open_issues/64-bit_port.mdwn @@ -13,78 +13,163 @@ License|/fdl]]."]]"""]] [[!inline pages="title(Is there a 64-bit version?)" feeds="no" raw="yes"]] -There is some initial support in the master branch. -As of 2012-11-20, it only supports the [[microkernel/mach/gnumach/ports/Xen]] platform for now. - **What is left for initial support (32-on-64) is** - * add 64bit boot support from grub's multiboot - * implement 32/64 RPC compatibility for RPCs served by kernel. - -See [[http://lists.gnu.org/archive/html/bug-hurd/2012-04/msg00000.html]] + * Fixing bugs :) **For pure 64bit support, we need to** - * add 64bit definitions in binutils - * add 64bit definitions in gcc - * implement 64bit variants of code in glibc/sysdeps/mach/i386 and glibc/sysdeps/mach/hurd/i386 - * implement 64bit variants of code in libpthread/sysdeps/i386, libpthread/sysdeps/mach/i386, libpthread/sysdeps/mach/hurd/i386 - * fetch from Linux 64bit variant of code in ./pfinet/linux-src/arch/i386 and ./pfinet/linux-src/include/asm-i386 - * define the mig ABI - * bootstrap a distrib, e.g. Debian hurd-amd64 (see [[https://jenkins.debian.net/view/rebootstrap/job/rebootstrap_hurd-amd64_gcc8/]] ) - -# IRC, freenode, #hurd, 2011-10-16 - - <youpi> it'd be really good to have a 64bit kernel, no need to care about - addressing space :) - <braunr> yes a 64 bits kernel would be nice - <braunr> i guess it wouldn't be too hard to have a special mach kernel for - 64 bits processors, but 32 bits userland only - <youpi> well, it means tinkering with mig - -[[mig_portable_rpc_declarations]]. - - -# IRC, freenode, #hurd, 2012-10-03 - - <braunr> youpi: just so you know in case you try the master-x86_64 with - grub - <braunr> youpi: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689509 - <youpi> ok, thx - <braunr> the squeeze version is fine but i had to patch the wheezy/sid one - <youpi> I actually hadn't hoped to boot into 64bit directly from grub - <braunr> youpi: there is code in viengoos that could be reused - <braunr> i've been thinking about it for a time now - <youpi> ok - <braunr> the two easiest ways are 1/ the viengoos one (a -m32 object file - converted with objcopy as an embedded loader) - <braunr> and 2/ establishing an identity mapping using 4x1 GB large pages - and switching to long mode, then jumping to c code to complete the - initialization - <braunr> i think i'll go the second way with x15, so you'll have the two :) - - -## IRC, freenode, #hurd, 2013-07-02 - -In context of [[mondriaan_memory_protection]]. - - <xscript> BTW, it's not like I have an infinite amount of time for this, - but having 64-bit support would be valuable for me, so I might contribute - that back if it's not a too monumental task - <xscript> I saw some discussions about 32bit apps on top of 64bit mach, but - I'd like a full 64bit system - <xscript> any clues? - <xscript> I suppose the compiler support is all there already - <xscript> is MIG (and mach) the only piece missing? - <braunr> the problem is the interfaces themselves - <braunr> type widths - <braunr> as passed between userspace and kernel - - -## IRC, OFTC, #debian-hurd, 2013-10-05 - - <dharc> and what about 64 bit support, almost done? - <youpi> kernel part is done - <youpi> MIG 32/64 trnaslation missing - -[[mig_portable_rpc_declarations]]. + * bootstrap a distrib + * port gdb + * Fix bugs :) + * Notably it seems to be requiring at least 2G memory to boot. + +**Installing a 64bit chroot** + +You can use the pre-built image from https://people.debian.org/~sthibault/hurd-i386/initrd-amd64.img.gz and boot that. + +Make sure to have `debootstrap >= 1.0.128+nmu2+hurd.1` + + debootstrap --foreign --verbose --arch hurd-amd64 --include=debian-keyring,wget,curl,inetutils-ping,openssh-server,openssh-client,nano,less --keyring=/usr/share/keyrings/debian-keyring.gpg sid chroot-hurd-amd64 https://people.debian.org/~sthibault/tmp/hurd-amd64 + mkdir chroot-hurd-amd64/etc/apt/trusted.gpg.d + ln -s /usr/share/keyrings/debian-keyring.gpg chroot-hurd-amd64/etc/apt/trusted.gpg.d/ + +Then boot it, it will drop you into a shell. You'll probably want to use a nicer shell: + + bash + +You need to make / writable: + + fsysopts / --writable + +and then run the second stage of the deboostrap (and clear debs): + + /debootstrap/debootstrap --second-stage + apt clean + +set a root password: + + passwd + +Avoid core dumpings for now (not supported and hangs): + + rm -f /servers/crash + ln -s crash-kill /servers/crash + +Disable the Hurd console, buggy for now: + + export TERM=mach + nano /etc/default/hurd + # set ENABLE to 'false' + +And reboot: + + reboot-hurd + +After reboot, you'll probably want to setup network: + + vi /etc/network/interfaces + # put there this: + auto /dev/eth0 + iface /dev/eth0 inet static + address 10.0.2.15/16 + gateway 10.0.2.2 + +**Creating a 64bit disk image** + +You can use the pre-built image from https://people.debian.org/~sthibault/hurd-i386/disk-amd64.img.gz and boot that. + +To make a bootable system we really better make the disk image partitioned, and mount the partition: + + dd < /dev/zero > disk.img bs=1M count=1 seek=1000 + fdisk disk.img + # create a new primary partition spanning the whole disk: n p and just accept the defaults, and finish with w + settrans -ca disk /hurd/storeio -T typed file:disk.img + settrans -ca disk1 /hurd/storeio -T typed part:1:file:disk.img + mke2fs disk1 + settrans -ca chroot-hurd-amd64 /hurd/ext2fs disk1 + +(here we assume that fdisk puts the partition at sector 2048, that's indeed the +current default behavior) + +Then run the same debootstrap command as above. + +You can then make the disk bootable: + + mkdir chroot-hurd-amd64/boot/grub + tee chroot-hurd-amd64/boot/grub/grub.cfg << 'EOF' + set default="0" + set timeout=5 + menuentry "Debian GNU/Hurd amd64" { + insmod ext2 + set root=(hd0,1) + multiboot /boot/gnumach-1.8-486.gz root=part:1:device:wd0 + module /hurd/pci-arbiter.static pci-arbiter \ + --host-priv-port='${host-port}' --device-master-port='${device-port}' \ + --next-task='${disk-task}' \ + '$(pci-task=task-create)' '$(task-resume)' + module /hurd/rumpdisk.static rumpdisk \ + --next-task='${fs-task}' \ + '$(disk-task=task-create)' + module /hurd/ext2fs.static ext2fs --readonly \ + --multiboot-command-line='${kernel-command-line}' \ + --exec-server-task='${exec-task}' -T typed '${root}' \ + '$(fs-task=task-create)' + module /lib/ld-x86-64.so.1 exec /hurd/exec '$(exec-task=task-create)' + } + EOF + grub-install --modules="part_msdos ext2" --boot-directory chroot-hurd-amd64/boot disk + settrans -ga chroot-hurd-amd64 + settrans -ga disk + settrans -ga disk1 + +Then boot it, and proceed like for the chroot case. + +**Creating a pbuilder chroot** + +Here is a sample `/etc/pbuilderrc`: + + MIRRORSITE=https://people.debian.org/~sthibault/tmp/hurd-amd64 + AUTOCLEANAPTCACHE=yes + EXTRAPACKAGES="eatmydata" + if [ -z "$LD_PRELOAD" ]; then + LD_PRELOAD=libeatmydata.so + else + LD_PRELOAD="$LD_PRELOAD":libeatmydata.so + fi + export LD_PRELOAD + DEBOOTSTRAPOPTS=( + '--variant=buildd' + '--force-check-gpg' + '--keyring=/usr/share/keyrings/debian-keyring.gpg' + ) + APTKEYRINGS=(/usr/share/keyrings/debian-keyring.gpg) + +And this is needed until we get the `aptitude` package built: + + sudo ln -sf pbuilder-satisfydepends-apt /usr/lib/pbuilder/pbuilder-satisfydepends + +And then you can run `sudo pbuilder create` , `sudo pbuilder login` , `pdebuild` + +**Installing from the debian-ports archive** + +For now it's quite empty (not even gcc), but it can be debootstrapped. That will be used to build packages on the buildds. + + debootstrap --foreign --verbose --arch hurd-amd64 --extra-suites=unreleased --include=debian-ports-archive-keyring --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg sid chroot-hurd-amd64 https://deb.debian.org/debian-ports/ + +**Installing proper & more packages** + +The `people.debian.org` repository is only for bootstraping the distribution. Proper packages are getting uploaded on the usual mirror: + +``` +deb http://deb.debian.org/debian-ports sid main +deb http://deb.debian.org/debian-ports unreleased main +``` + +**Installing a 64bit system** + +In principle crosshurd should be working, one however should add this source to get more packages for now: + + deb http://people.debian.org/~sthibault/tmp/hurd-amd64 unstable + +into /etc/crosshurd/sources.list/gnu |