All posts by leviathan

LibreSilicon: Liberty as solution for everything

Tell us about yourself

I’ve installed my first open source operating system, OpenBSD, and wrote my first C-code, when I was 9 years old, back when I was growing up in Switzerland.

I was inspired by the idea of a sentient computer (Artificial General Intelligence) controlling a robot with the shell of a Pontiac Trans-Am, being a hero and championing the cause of the innocent, the helpless, the powerless, after watching Knight Rider.

David Lanzendörfer

But like with all children, when you grow up, you gotta realize that the Easter bunny and Santa ain’t real.

For me accepting that KITT wasn’t a reality (yet), was probably more painful, than the realization that Santa doesn’t exist, for an average child, who doesn’t have a measured IQ of over 140, and believed into those obviously impossible beings in the first place.

My reaction was, that I swore to myself, that I’d become the best hacker and engineer possible, so that I become capable of building KITT, the greatest hero of all times, for real, so I’ve dedicated my life to that goal.

Back in Switzerland, that wasn’t possible however, because the degree of creative freedom, and the jobs available for an engineer are very limited there, and developing even simple machines, is way too expensive.

I had to venture to China, where I gathered practical experience with engineering over many years, until, due to unrests in Hong Kong, where our lab was located and also some personal conflicts, as well as a lack of funding, forced me to move to south Europe.

It was a long hard journey, with lots of emotional and physical pain involved, surviving despite the odds, and growing with every problem, while getting my believe only enforced, that the world needs a hero like KITT to be real.

24 years later, I’ve now not only mastered material science skills, which allowed me to design my own open source semiconductor manufacturing process, LibreSilicon (https://libresilicon.com), but I also made lots of progress in the field of AI research and robotics, which I plan to focus more on, as soon as LibreSilicon takes off more than it already has, and has a life on its own, which doesn’t require my permanent involvement.

I was asked to mention some of my social media at this point of the article, so for starters I’ve got a Twitter handle as well as a LinkedIn profile, as well as a YouTube channel where I have videos talking about science, politics and pop-culture.
I also run a self-hosted Fediverse instance, which you can find here: https://mastodon.libresilicon.com/@leviathan

Where do you see yourself in 10 years?

It’s the oldest HR question in the book, but lets outline a bit here.

Long term I hope that I can make enough money with some of my side-hustles, so that I can afford some small homestead somewhere here in south Europe, so that I can focus on my research, while enjoying the peace and quietness, with the only noises being the wind, the sound of the water being pumped around by my autonomous, self-managing, AI-driven aquaponics system, and maybe the noise of the motors in my vertical aquaponics farm, when the AI deems another piece of vegetable ready to be harvested… and maybe the sound of some baby goats in pajamas hopping around.

I hope that with all the progress I made in the field of engineering, in all the areas I’ve been active so far, that I might not only be able to build a virtually indestructible sentient car in my barn, but can also use the technology for automatizing food production to a degree, where I could feed an entire village or maybe even city with virtually no costs involved, essentially solving world hunger once and for all.

What problem does the project solve?

LibreSilicon actually solves multiple, very existential problems.

For starters, the issue with various intelligence agencies, like the NSA, Mossad and maybe even the Chinese Intelligence Agencies putting hardware back doors into consumer products.

I’m not comfortable with running my smartphone on not only software, which is probably bugged already by the NSA and only the gods (Eris, Zeus, etc… Yes. I’m a worshiper of the ancient Greek gods) know, what other nosy spying agencies, but even the system on chip itself… not to mention my future hero KITT, because I don’t want him to get hacked either!

So I decided to make a process standard for manufacturing semiconductors, which allows to trace the entire manufacturing process from the Verilog/VHDL/Chisel through the RTL down to the transistor layout level and visual verification of the physical product.

I knew from the get go, when I lost access to NFF, that my access to lab equipment would be gone for good, because a lack of cooperation from people in power all over Europe was the reason, I had to go to China in the first place.

But you know, you enjoy it as long as it’s lasting. Carpe diem.

That’s my google photos drive with all the pictures from the clean room back in Hong Kong, nice memories of lots of successful builds: https://photos.app.goo.gl/YeZZYWzq5jVN4WCCA

For now we’re relying on Skywater for our tape-outs and are right now porting our original PearlRiver test wafer to the Skywater platform in cooperation with the MIT, eFabless, Google and NIST.

But besides shutting out nosy spying agencies from your smartphone, and giving you back the control over your own data, giving you back the privacy you’ve been continuously loosing, even with a higher pace ever since 9/11, due to the “patriots”-act, LibreSilicon also solves another problem, which is actually at the root of the prior one: Monopolies

Back doors in chips are only possible, because the amount of foundries in the world can be counted on a hand or two, and considering that those foundries are located in a few countries, those countries can use the power of the state to bully those manufacturers into putting the back doors into their products, the feds from the respective countries desire to have in there.

By democratizing and decentralizing semiconductor manufacturing the governments lose their death grip over that industry and their government overreach becomes impractical.

We can see it happen with 3D printers and decentralized currencies like BitCoin, which render all attempts by the government at controlling the currency or weapons (through gun control) futile.

I desire to achieve the same with LibreSilicon, for semiconductors, taking the power out of the hands of government and putting it back into the hands of the people.

More Liberty is my solution to everything, hence the name LibreSilicon

The team

We always were only a few people in the team and the only person who always stuck around in the team, besides me of course, while everyone came and went, was Hagen (https://www.linkedin.com/in/hagen-sankowski-14300910)

Team member of the decade: Hagen Sankowski


He and I designed the first version of the Pearl River test wafer, which I then manufactured in the clean room in Hong Kong and held up into the air during a talk at the Chaos Communication Congress.
From that moment on, we got a huge influx of new members, of the team, but Hagen and I stood the most active.

Another member of our team, who’s now very actively involved, especially in the area of coordination and organizing funding, is Philipp Gühring.

Best PR guy in our team: Phillip Gühring

Thanks to him, we’ve got now all the networking to Skywater, the MIT and Google, and have not only access to some kind of way for taping out our designs, but even better, even funding for it!

The role of NGI

Funding is of course a recurring topic, when it comes to hardware projects, because unless code, with hardware, especially semiconductors, you can’t just edit your code and recompile.

Every change in the hardware design means, that you’ve got to make a new layout, send it to the foundry and wait until your shuttle run went through, which means bugs can only be fixed in a 6 months interval or so.

One issue we encountered while dealing with NGI is the milestone based payment, which makes a lot of sense when dealing with software, but less so, when dealing with hardware, because your achievement of milestones is based on the factory tape out windows, and payment can only happen in 6 months intervals at best, which doesn’t match well, with the limited time of the road maps in the MoUs, which is the reason why the software based plans were able to claim their budget, while the more hardware focused ones didn’t.

Only now after an amendment I’m able to make at least use of roughly 50% of the finances in the funding.

It’s not the fault of NLNet, but just a result of the fact, that their funding scheme is more software oriented, than it is on hardware projects, where you more often than not have to go like “yeah, well, that ain’t working, lets gonna try it another way, alright”.

I’m looking forward to see, whether NLNet and NGI will introduce some heavily hardware oriented funding scheme in the future, which is more suited for a project like building microchips or a sentient bulletproof crime-fighting car with a dry sense of humor.

Cross compiler for z/oS

Go here: http://45.76.81.249/zOS

~.bashrc

export PATH=/opt/IBM/bin:$PATH
export CFLAGS="$CFLAGS -Wno-error"

Folders

mkdir PEP_ZOS
sudo mkdir -p /opt/IBM
sudo chown `whoami`:users -R /opt/IBM

Repositories

cd PEP_ZOS
git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
cd linux
git checkout v5.3.12
cd ..
git clone https://github.com/leviathanch/binutils.git
cd binutils
git checkout lev/master
git clone https://github.com/leviathanch/gcc.git
cd gcc
git checkout lev/master
cd ..
got clone https://github.com/leviathanch/glibc.git
cd glibc
git checkout lev/master
cd ..

Building steps

First we need to build the binutils with patches to generate and link bytecode recognized by the z/OS environment.

cd binutils/build

../configure --prefix=/opt/IBM --program-prefix=s390x-ibm-zos-gnu- --target=s390x-ibm-zos-gnu

make -j4

make install

cd ../..

Now we need to provide the kernel headers, since this is a requirement for building gcc and glibc (even if z/OS isn’t a Linux)

cd linux

make ARCH=s390 menuconfig (got to exit and save)

make ARCH=s390 INSTALL_HDR_PATH=/opt/IBM/s390x-ibm-zos-gnu headers_install

cd ..

Now we build the first stage of the gcc bootstrap phase

cd gcc/build

../configure --prefix=/opt/IBM --program-prefix=s390x-ibm-zos-gnu- --target=s390x-ibm-zos-gnu --disable-multilib --enable-languages=c,c++ --disable-shared --disable-checking

make -j4 all-gcc

make install-gcc

cd ../..

Now we build the GLIBC on which the rest of GCC depends

cd glibc/build

export CFLAGS="-Wno-error -I/opt/IBM/include -L/opt/IBM/lib64/gcc/s390x-ibm-zos-gnu/8.3.1 -I/opt/IBM/lib64/gcc/s390x-ibm-zos-gnu/8.3.1/include -static -fsplit-stack -O3 -fexec-charset=IBM-1047"

../configure --prefix=/opt/IBM/s390x-ibm-zos-gnu --host=s390x-ibm-zos-gnu --target=s390x-ibm-zos-gnu --build=s390x-ibm-zos-gnu --disable-multilib --with-headers=/opt/IBM/s390x-ibm-zos-gnu/include --disable-shared --disable-nscd

make install-bootstrap-headers=yes install-headers

make -j4 csu/subdir_lib

install csu/*.o /opt/IBM/s390x-ibm-zos-gnu/lib/

touch /opt/IBM/s390x-ibm-zos-gnu/include/gnu/stubs.h

s390x-ibm-zos-gnu-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o /opt/IBM/s390x-ibm-zos-gnu/lib/libc.so

cd ../..

Now we’ve got to build libgcc

cd gcc/build

make -j4 all-target-libgcc

make install-target-libgcc

cd ../..

Now we’ve got to finalize the GLIBC build

cd glibc/build

make -j4

make install

cd ../..

Adding DASD storage in Hercules+z/OS

So given you’ve got your nice z/OS copy from a special bay of pirates and you now wanna get cracking.
The only problem is: The storage is way too small.
The Hercules doc does here a good job in emulating not only the IBM mainframe but also the uselessness of IBM documentations.
Here a quick and dirty guide on how to initialize a new DASD device from the UNIX shell, so that you don’t have to fight with the base system and so.

First you’ve got to go to your images folder and create an image.
In my case it’s located in the DASD subfolder called GNU.

The following command should give you around 6GB of storage (8000 cylinders)

dasdinit -z LOCAL.CCKD 3390-3 LOCAL 8000

Next we have to add it into our hercules.cnf which should look somehow like that.
Make sure the address (0AB5) doesn’t collide with already existing DASD lines.

0AB5    3390 $(DASD)/GNU/LOCAL.CCKD

Next we start up the mainframe (https://blog.the-leviathan.ch/?p=1361) and go into the x3270 command shell (not the one with the ncurses like selection menu)

Here we first bring the DASD offline with

V 0AB5,OFFLINE

Now we go into the telnet session and create a file, let’s say script.txt with the following content

//ICKDSF01 JOB  (FB3),'INIT 3390 DASD',CLASS=A,MSGCLASS=H,
//             NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//* 3380/3390 INITIALIZE VOLUME
//*
//*   VARY DEVICE ONLINE/OFFLINE AT LEAST ONCE BEFORE RUNNING
//*       THIS JOB, OR I/O ERROR WILL OCCUR AND NOT INITIALIZE
//*
//*   CHANGE
//*     VVVV - TO CUA ADDRESS OF DASD
//*   NEWNNN - TO NEW DASD VOLID
//*
//*   THEN PLACE A VVDS AT CYL 0 TRK 10-14 WITH JOB IDCDEFVV
//*
//STEP01  EXEC PGM=ICKDSF,REGION=8M
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
 INIT -
      MAP /* MAP DEFECTS */ -
      UNIT(0AB5) /* ADDRESS */ -
      NOCHECK -
      CONTINUE -
      NOVERIFY /* DO NOT CHECK VOLID */ -
      VTOC(0,1,450) /* 8000 CYL VTOC */ -
      INDEX(30,1,90) /* 8000 CYL INDEX */ -
      OWNERID('IBMUSER') -
      VOLID(LOCAL) /*  NEW VOLID  */
//*
//
//*

And now comes they key part no one tells you about:
In your UNIX shell on Telnet you just pipe the content of this textfile to the z/OS command “submit”

IBMUSER:/u/ibmuser: >submit script.txt
JOB JOB02860 submitted from path 'script.txt'

In case you get something like the message below, you can reply by using the REPLY command and the number with the asterisk.

Now we wait for a few minutes and after that we go back into our x3270 shell and bring the DASD back online with (Oh wonder)

V 0AB5,ONLINE

Now we can define an aggregate from this volume with zfsadm and format it.

IBMUSER:/u/ibmuser: >zfsadm define -aggregate PEP.LOCAL -volume LOCAL -cyl 8000
IOEZ00248I VSAM linear dataset PEP.LOCAL successfully created.

IBMUSER:/u/ibmuser: >zfsadm format PEP.LOCAL
IOEZ00552I Multi-file system aggregates are restricted and support will be removed; plan to migrate.
Done.  PEP.LOCAL is now a zFS aggregate.

IBMUSER:/u/ibmuser: >zfsadm attach PEP.LOCAL
IOEZ00552I Multi-file system aggregates are restricted and support will be removed; plan to migrate.
IOEZ00117I Aggregate PEP.LOCAL attached successfully

IBMUSER:/u/ibmuser: >zfsadm create -filesystem PEP.LOCAL -aggregate PEP.LOCAL -size 6291456
IOEZ00099I File system PEP.LOCAL created successfully

For mounting it temporaraly you can execute the following command:

IBMUSER:/u/ibmuser: >/usr/sbin/mount -f PEP.LOCAL -t ZFS -o 'AGGRFULL(90,5)' /usr/local
IBMUSER:/u/ibmuser: >

OR

tso -t "MOUNT FILESYSTEM(PEP.LOCAL) TYPE(ZFS) MOUNTPOINT('/usr/local') MODE(RDWR)"

If you wanna add it to the auto mounted folders you’ve got to edit the mounting table in TSO. Just follow the white rabbit in the following screenies down the rabbit hole.

Now we add the TSO command from above here in the table at the end of the other mount directives.

In order to get some more newlines you go to the beginning of the number of the empty line and over type the first digit with R (for repeat) and then press enter.

Type “save” in the command field and then the command “end” (you get there by navigating there with the tab key), and as many ends as needed to come back to the top view.

Booting z/OS 1.1 on Hercules

So assuming you got your z/OS 1.1 DASD files from a special bay of pirates (Magnet link) and you now totally wanna try out this “cool software”, those bankers are using.
First: Bankers aren’t cool. Drugs, especially Cocaine aren’t cool and hookers aren’t that expensive either, you can afford them with more productive jobs as well.
Second: IBM products aren’t cool either.

Now that that’s said.
Check out this link for setting up the networking for your virtual main frame under Hercules: http://modernhackers.com/install-ibm-z-os-mainframe-under-gns3

First you might wanna arrange your windows like this with two open x3270 terminal connecting to your Hercules interface like shown in the pic here.

After you have this. You enter “ipl a80” in the Hercules interface and you will see after a moment in one of the two x3270 windows, how the system starts booting.

When it’s done booting it will look like that.
The second window now provides you with a management interface.

One of those x3270 windows is a shell the other one is the configuration management tool from z/OS.

You can switch forth and back, using ESC in the Hercules terminal (the very left one) in order to either have a Hercules shell or have an overview of the CPU usage.

Now you can type in the right upper shell:
STOP TCPIP
START TCPIP
STOP OMVS
START OMVS

After that you should be able to connect to your z/OS using telnet on port 1023.

When you wanna shut down your system, as usual with IBM, it’s not so simple.

First you go into the x3270 window and type “S SHUTSYS” and press enter.

You wait until it looks like that and then type “Z EOD” and then press enter.

It will write out the logs for a while and then will tell you, that it’s done.
At that point where it looks as following you can go to the Hercules terminal and enter quit in order to terminate the emulator.

Here I typed another time “Z EOD”, just to make sure it’s done writing everything down, because z/OS (like AIX as well) are absolutely pussies, when it comes to corrupted file systems.

They’ll tell you “high availability… blah blah”. BS.

Workaround: nouveau-dri KDE plasma crash

If you had the issue already that basically everything in your KDE environment stops working all the sudden after a dist-upgrade and you end up on a black screen instead of the plasmashell after login, then you can try this.

It solved this issue for me.

Add this line into your .bashrc

export MESA_GL_VERSION_OVERRIDE=2.1

At the next login the desktop should appear again.

The problem seems to be that older nVidia cards have some buggy execution of some of the more modern OpenGL 3.1 commands, so forcing it to be using OpenGL 2.1 is safer.

PandaBoard-ES with upstream u-boot + kernel (take 1)

Hi
A friend of mine asked me whether I could buy for him a pandaboard from the factory in Shenzhen directly and set it up with a Linux for him. Here are the steps I went through to get it running.

Insert the SD card for the boot media (we assume it’s /dev/sdX) and then do the following.
Zero the beginning of the SD card:

dd if=/dev/zero of=/dev/sdX bs=1M count=8

Start fdisk to partition the SD card:

fdisk /dev/sdX

At the fdisk prompt, delete old partitions and create a new one:
Type o. This will clear out any partitions on the drive.
Type p to list partitions. There should be no partitions left.
Now type n, then p for primary, 1 for the first partition on the drive, 2048 for the first sector, and then press ENTER to accept the default last sector.
Write the partition table and exit by typing w.

Create and mount the ext4 filesystem:

mkfs.ext4 /dev/sdX1
mount /dev/sdX1 /mnt

Download and extract the root filesystem:

wget http://archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz
bsdtar -xpf ArchLinuxARM-armv7-latest.tar.gz -C /mnt
sync

If you don’t have yet installed a cross compiler for ARM, you should do so, for instance with

zypper in cross-arm-linux-gnueabi-gcc

then clone and compile your u(nified)-boot(loader):

git clone git://git.denx.de/u-boot.git
cd u-boot
export CROSS_COMPILE=arm-linux-gnueabi-
make omap4_panda_config
make

Then write your boot loader to the SD card:

dd if=MLO of=/dev/sdX count=1 seek=1 conv=notrunc bs=128k
dd if=u-boot.img of=/dev/sdX count=2 seek=1 conv=notrunc bs=384k

 

Dragoncore/Loongson/龙芯 (step one)

Hi folks
I’m now living in China.
Here are some pictures of my first run of the 龙芯芯片.
Although the lab is still a total mess/battle zone is started working on the FOSS tablet project already.
As you can see the board I got from 龙芯 does power up and loads the PROM.
Next step is to compile a vmlinux for 2H in order to test the system.
IMG_20151108_014651 IMG_20151108_014641 IMG_20151108_014350 IMG_20151108_014342 IMG_20151108_004149