xMach icon indicating copy to clipboard operation
xMach copied to clipboard

Boot

Open AlessandroSangiuliano opened this issue 3 years ago • 18 comments

Hello finally i find the time to build it, and i had success.

The problem is that Mach boots but the bootstrapserver never finds lites also if i give the path and the right drive. This happens probably because lites resides on ext2 fs ( i managed to build all from an old woody debian), i don't know if it is really able to read from extfs.

I saw on the blog a link with a preinstalle version of netbsd1.1 with the old ufs (UFS1), the filesytem that mach should be able to read. Unfortunately the link is dead.

AlessandroSangiuliano avatar Nov 09 '22 08:11 AlessandroSangiuliano

I had a catastrophic failure with my storage.. I had essentials backed up, but yeah things were lost.

it should be easy enough to re-create a root file system by installing NetBSD 1.1

neozeed avatar Nov 11 '22 08:11 neozeed

Yeah, i was searching NetBSD1.1 not easy right now.

AlessandroSangiuliano avatar Nov 11 '22 20:11 AlessandroSangiuliano

I found a copy here: https://archive.netbsd.org/pub/NetBSD-archive/NetBSD-1.1/i386/ I'm downloading it, so I can do an install soooon...

sorry I keep somehow hitting the close button!

It should run on ext2 although I'm imagining it'll need some static ext2fsck among other things, I am thinking it should be able to run static linux binaries, so it may be all fun to mess with.

neozeed avatar Nov 11 '22 20:11 neozeed

netbsd11-clean.zip

I just installed NetBSD on Qemu 1.6 (yeah I know its old but whatever) I didn't configure networking or anything else, just touched and made directory paths so it'll boot without complaining. I didn't install or prep mach at all.

neozeed avatar Nov 11 '22 22:11 neozeed

Here is my disk & grub ISO... I'm using qemu..

qemu.exe -L pc-bios -hda net11.vmdk -no-fd-bootchk -M isapc -m 16 -fda net11\kcadp11.fs -cdrom super_grub2_disk_i386_pc_2.04s1.iso -boot d

I don't know why but init is always dying :|

xmach-try2.zip init dying on mach

neozeed avatar Nov 11 '22 23:11 neozeed

i586-linux2.tar.gz I assume you already have a cross GCC I use this under Linux (under wslv2!)..

neozeed avatar Nov 11 '22 23:11 neozeed

Yes i'm using that compiler but on linux without any problem, i'm also trying to get openmach compiled. The nice thing is that xMach builds without problems so i have a starting point to look and play with the code :)

AlessandroSangiuliano avatar Nov 12 '22 07:11 AlessandroSangiuliano

Yes with the actual xMach we have, the kernel seems unable to read ext2fs, so UFS is neded, but in lites there is support for ext2, the problem is that i could not boot lites from linux because mach could not read ext2

AlessandroSangiuliano avatar Nov 12 '22 07:11 AlessandroSangiuliano

I think it may have been NetBSD 1.3 that worked? I’ll have to mess around more I think the 1.1 may be relevant to a stock Lites

neozeed avatar Nov 12 '22 17:11 neozeed

I was wrong, it's 1.0

neozeed avatar Nov 12 '22 20:11 neozeed

Mach+ext2.zip

qemu.exe -L pc-bios -hda netbsd-1.0.vmdk -cdrom ..\super_grub2_disk_i386_pc_2.04s1.iso -boot d -net none -device ne2k_isa,iobase=0x300,irq=5,netdev=ne -netdev user,id=ne,hostfwd=tcp::42323-:23 -serial none -parallel none -hdb ..\linux-500.vmdk -boot d

So yeah, boot off the grub CD...

hit escape on grub

kfreebsd (hd0,bsd1)/Mach boot

tell mach it's root is: /dev/hd0a/mach_servers

xMach booted with NetBSD 1 0 root

And it'll pick up the network and you can telnet in even.

telnet into xMach

The ext2fs wasn't building as the configure script has it pulling from some weird variable...

if test -z "$LITES_CONFIG"; then
#       LITES_CONFIG="STD+WS"
        LITES_CONFIG="STD+WS+ext2fs+msdosfs+slice"
fi

So I had just manually added it in. I'm not sure what to do about the slice/partitioning scheme but it's compiled in at least.

the zip has a stored 7z as it compressed far better.

neozeed avatar Nov 12 '22 23:11 neozeed

Yes thank you, in the while installing an ubuntu 14.10 on a VM iwas able to build OpenMach. I just have to fix the mkbsdimage that creates a weird assembly file Mach.mods.S with some error/ancient assembly syntax; it is used to build a bootable bsd image

AlessandroSangiuliano avatar Nov 13 '22 06:11 AlessandroSangiuliano

Can you post in what it was exactly? I’m terrible at assembly. I’ve been experimenting with using newer GCC on the source and turning on O2 as well

neozeed avatar Nov 13 '22 11:11 neozeed

Yes sure:

Mach.mods.S.txt

I added the .txt extension for the upload.

This is generated when you run the make command, afdter the kernel build with success, it tries to create a BSD bootable image. This file is necessary for that and is generated all the time, probalby due fo the more recent tools than the ones used at the times, something goes wrong. If you look there are ' " ' that are not closed in the right way so the compiler cries about junk at the end of file:

line 12: Error, junk at the end of line. First urecognized character is '.'

This is quite obvious because at line 6 there is another ' " ' that is opening a string adn gets not closed.

The problem is finding who and how this .S is generated and fix the string generation because all the time you run make the file gets deleted and regenerated.

AlessandroSangiuliano avatar Nov 13 '22 15:11 AlessandroSangiuliano

However i alsod found this to play with:

https://github.com/slp/osfmk-mklinux

This dude, i remember, is inside the Hurd developmnet or at least he was.

I found the ode4Linux too here:

https://github.com/andreiw/ode4linux

This should build with gcc 4.8 and probably with 4.9 too or at least i hope, other wise i need to install anothe ubuntu this time the 14.04 that had gcc-4.8.

Why installing all these VMs, well is faster than messy up trying to install old compilers on new OSes.

AlessandroSangiuliano avatar Nov 13 '22 15:11 AlessandroSangiuliano

I'm messing with a gcc 4.12 ..

cc1: note: obsolete option -I- used, please use -iquote instead
In file included from ../../../kernel/libmach/c/proc_reg.c:25:
../../../kernel/include/mach/machine/proc_reg.h: In function ‘get_eflags’:

And yeah seems everything with quotes and assembly inline or other is all messed up

neozeed avatar Nov 13 '22 15:11 neozeed

Well, when i checked for the documentation of -iquote i found nothing, if you have some reference please help me, fixing that would be a good starting point.

AlessandroSangiuliano avatar Nov 13 '22 16:11 AlessandroSangiuliano

Again here.

I found where the .S is generated. If you want i started a discord server called mach Revival.

https://discord.gg/UBsxMftGEk

AlessandroSangiuliano avatar Nov 13 '22 17:11 AlessandroSangiuliano