davidgiven / ack

The Amsterdam Compiler Kit
http://tack.sf.net
Other
424 stars 60 forks source link

compile minix2 on *any* just *any* hardware #47

Closed gideondsouza closed 7 years ago

gideondsouza commented 7 years ago

Is there some way the ack can be used to compile minix 2 on any hardware. I'm trying hard to follow the book for minix2 but I want to be able to play with code on a real machine.

Is there an old x86 machine I can buy? I don't know what specific model would work though.

Thanks

kernigh commented 7 years ago

Sorry, I can't answer questions about Minix 2. I don't run it.

The ack in this GitHub repository is a cross-compiler that runs on Linux and OpenBSD, and builds programs for Linux and a few other platforms. We have old code for Minix, but it is one of the old platforms that doesn't work now. We have the libsys (mach/minix/libsys) and the descr (lib/minix/descr), but we might be missing the cv.

With some work, one might update the old code and cause the ack to cross-compile from BSD or Linux to Minix. I don't know any person who wants to do such work.

davidgiven commented 7 years ago

It's worth bearing in mind that Minix 2 comes with its own custom build of the ACK --- you should be able to build Minix 2 on Minix 2. It runs fine in virtualisation on qemu (although it might need some fiddling to get networking to work). There are some images available here:

http://minix1.woodhull.com/pub/demos-2.0/

...although they're all quite old.

Randrianasulu commented 1 year ago

So, I tried to compile old 5.6 release as i386/linux -> minix 16 bit i86 but something went wrong (most likely due to my wild hammering, trying to add or modify some files that were failing to compile or missing, by using current git as source of hints) .... I think syscall interface failed to compile, and old C part too. ANSI C part compiles, but I guess some parts of build want old C working, looking at Out files?

It goes as far as

guest@slax:/dev/shm/ack/examples$ ../../ack-bin/bin/ack -mminix mandelbrot.c -o mand -ansi -v      
cem mandelbrot.c
 "mandelbrot.c", line 31: (strict) qualifier error                                                  
opt mandelbrot.k                                                                                   
be mandelbrot.m                                                                                   
as mandelbrot.s                                                                                   
led mandelbrot.o                                                                                   
led: can't read /dev/shm/ack-bin/lib/minix/head_em (fatal)

Also, found older Minix ACK release announced at usenet group, found by google and still alive at archive.org:

https://web.archive.org/web/20070910201015/http://www.laurasia.com.au/ack/index.html#download

but it does not work (as documented) on i86 Minix 2.0.4 (I run that in qemu, from hdd image of Minix Quick and Dirty edition) - cc in this version of Minix does not put temporary object files in obj, and something ran out of memory. Building on i586 Slackware 15.0 also does not produce full set of files - may be gcc fails to preprocess file for yacc?

Anyway, it was some adventure, guess for now exact source of 'cc' in Minix remain mystery.

https://github.com/davidgiven/minix2 - I used VM image from there

Randrianasulu commented 1 year ago

Ah, minix sources compiles, just I need to manually replace

cc -P -E -Ias/i386 -Ias -Ih as/comm2.y > obj/as/i386/as.y

into cpp -P -E -v -Ias/i386 -Ias -Ih as/comm2.y > obj/as/i386/as.y

in few places as make goes.