Zero Dereference – Telegram
Zero Dereference
127 subscribers
3 photos
3 files
372 links
Interesting links related to systems programming, hacking, and science.

Contact: @richiefreedom
Download Telegram
Commodore 64, Sinclair ZX Spectrum and other home computers of the past gave their users unique user experience. They weren't toys, they were real computers with built-in programming environments based on a variant of Basic. You didn't need to look for any additional software to start programming, Basic was flashed inside the ROM chip, so after pressing the power button it was ready for your brave experiments. Moreover, every computer was accompanied by a detailed manual on its internals, memory map, I/O registers, etc. And the manual was observable, you could study it and remember most of the things. Modern computers differ a lot in this sense. Just imagine studying the whole systems programming guide from Intel! Ridiculous!

Some guys dream about old fashioned home computers that can be used today. The following project is a bare metal firmware for RaspberryPi with an interpreter of Basic.

https://www.highcaffeinecontent.com/rpi/
Adam Dunkels made many impressive things. One of them is twIP - a really tiny TCP stack that fits in one Twitter message. Of course, it isn't a full featured networking stack, such little piece of code just responds to pings, but pay attention to its size - just 139 characters.

http://dunkels.com/adam/twip.html
Linux works well on plenty of 32 and 64 bit architectures with and even without memory management unit. But, is there any way to run Linux on some 8 bit microcontroller? Actually, it is. Everything you need is enough memory and an emulator for any popular processor architecture supported by Linux.

http://dmitry.gr/index.php?r=05.Projects&proj=07.%20Linux%20on%208bit
Indie developers still make new games for NES. Some of them pick a variant of the 6502 assembly language, other ones write their games in C. Developers of the game "What Remains" decided to use own lisp-style programming language based on Racket Scheme and compiled to assembly.

http://www.dustmop.io/blog/2019/09/10/what-remains-technical-breakdown/
On his YouTube channel Luke Smith talks about various lightweight UNIX tools with suckless philosophy. He also has a number of exciting videos on history, politics and Latin.

https://youtube.com/c/lukesmithxyz
The best way to learn the ARMv8 assembly language is reading of ARMARM (ARM Architecture Reference Manual), but if you have no time and need to master only application-level assembly programming — some short tutorial would be enough. One of them can be found below. This tutorial gives an overview of ARMv8, its instruction set and common code patterns. It also shows how various cryptograpic algorithms can be implemented using the assembly language.

https://modexp.wordpress.com/2018/10/30/arm64-assembly/
For a long time I have been collecting examples of extremely tiny software for embedded applications. The following library written by Adam Dunkels was one of the first citizens of the collection. Protothreads provides a kind of coroutines with very little overhead (2 bytes per "thread"), moreover it doesn't use any architecture-dependent context switching code - all the magic is done using a layer of well-organized macros, generating state machines inside functions.

http://dunkels.com/adam/pt/
Have you heard about any fork or alternative distribution of TempleOS? It exists! Shrine is a distribution of Temple OS with traditional UNIX-like shell, networking, package management and lower memory consumption.

https://github.com/minexew/Shrine
TempleOS is an alien operating system. It uses own programming language, own concept of document-oriented user interface, it can be developed only on TempleOS itself.

If somebody wants to add a new application to this OS, the system forces him/her to use HolyC and uncommon system libraries. But most of the systems software today is written in C. Writing this application in C would be a good idea, right?

In his blog post Jack Whitham shows the way to port C programs to TempleOS by implementation of a loader in HolyC, which can load object files built for another operating system. He also made a port of uclibc to run unmodified software made in conformance with the C standard.

https://www.jwhitham.org//2015/07/porting-third-party-programs-to-templeos.html
The JVM compiler interface allows you to replace the default JIT compiler by your own, written in Java. Graal uses this interface to get its job done. You can find more details by clicking the link below.

https://chrisseaton.com/truffleruby/jokerconf17/
I have seen many object systems for C. Most of them used the macro language of the C preprocessor to generate boilerplate code emulating classes and objects with the flavour of C++.

The following solution is totally different. It resembles the object systems of Common Lisp and Objective C. It uses crazy macro-magic to parse new OO-related keywords. Parsing with macros, is it really possible? Yes, the authors use a kind of functional language implemented on top of the C preprocossor's language to safely transform its input and provide meaningful error messages. The system implements multi-dispatch and multi-forwarding of messages, generics, contracts and exceptions.

https://arxiv.org/pdf/1003.2547.pdf
Linus Åkesson noticed that Unix pipes connecting /dev/zero and /dev/null resemble electrical circuits. He wrote a program that implements an analogue of a transistor and made basic logic gates. Thus, it is possible to make a processor and do arbitrary computing.

https://www.linusakesson.net/programming/pipelogic/index.php
There is always a gap between the denoscription of an algorithm and its commercial implementation. For example, popular libraries for decoding images look very monstrous. This is due to the fact that their code is highly optimized, they support many versions of fomats that they work with, etc. One gets the impression that the data formats themselves are just as complex. But this is a false feeling. Compact and clear library implementations are possible. A good example is the implementation of the JPEG decoder in Python 3, which fits in 250 lines of clear code. Yes, this code does not work as fast as libjpeg or libjpeg turbo, but it is already good enough. A small investment of time in optimization can make it suitable for use even in commercial projects. By the way, a variant of this program, rewritten in C, is used in ToaruOS, one of the most impressive amateur operating systems.

https://github.com/aguaviva/micro-jpeg-visualizer
It turns out that there is a concise free book on algorithms with an emphasis on competitive programming.

https://cses.fi/book/book.pdf
Do you remember the article of Linus Åkesson about logic gates built for Unix pipes-centric model of electrical circuits? He made another strange computing machine built around Unix symlinks.

https://www.linusakesson.net/programming/symlinks/index.php
In a day, the biennial ACM Symposium on Operating Systems Principles will begin in Canada. Yesterday I flew to Toronto and plan to go to Huntsville by the beginning of the event. So, I will have the opportunity to write short notes on the topics reported or discussed on the conference.

https://sosp19.rcs.uwaterloo.ca/

#SOSP19
Zero Dereference pinned «In a day, the biennial ACM Symposium on Operating Systems Principles will begin in Canada. Yesterday I flew to Toronto and plan to go to Huntsville by the beginning of the event. So, I will have the opportunity to write short notes on the topics reported or…»