Apple M1 Assembly Language Hello World

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • m1n1

    A bootloader and experimentation playground for Apple Silicon

  • I see your userland M1 assembly language hello world and raise you a bare-metal M1 kernel assembly language hello world :-)

    https://github.com/AsahiLinux/m1n1/blob/main/src/start.S

    The first few lines of that will print 'm1n1' to the serial port as it initializes other things and eventually jumps to C code.

  • freebsd-src

    The FreeBSD src tree publish-only repository. Experimenting with 'simple' pull requests....

  • > Saying that "Linux [is] based on Unix" is not really accurate either.

    But Linux's x86 syscall ABI is based on the ABI of Unix (4.2BSD, I think.) Which is exactly the context the author was discussing.

    Compare and contrast:

    Modern Linux x86 ABI: https://chromium.googlesource.com/chromiumos/docs/+/master/c...

    Modern FreeBSD ABI: https://github.com/freebsd/freebsd-src/blob/master/sys/kern/...

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • HelloSilicon

    An introduction to ARM64 assembly on Apple Silicon Macs

  • I believe these were the first attempts at something similar back in July of last year. https://github.com/below/HelloSilicon

    I've been playing around with it as well; I think porting some common computer architecture textbooks to M1's (ARMv8) syntax would help a lot in terms of making assembly accessible to more people.

    You'd think $20 RISC-V (or ARMv7) boards would be the most accessible way to learn assembly, but I believe there's a lot of value in learning it on a particularly popular real-world platform like x86 or M1, despite the additional complexity and hurdles.

    Truthfully I think someone should really add the M1 syntax to the new version of VisUAL. https://github.com/scc416/Visual2 I've been intending to work on that to go along with porting https://bob.cs.sonoma.edu/IntroCompOrg-RPi/sec-instrs-1.html to ARMv8 for the same educational purpose but haven't quite found the time to really dive in.

  • unix-history-repo

    Continuous Unix commit history from 1970 until today

  • So, a few things. 4.2BSD was targeting VAX, which is most assuredly a 32 bit machine.

    Further, the common denominator you're seeing goes back much, much further than BSD itself. Behold! "Version 1" of UNIX, written in just 14 files of PDP-11 assembly. And if you look at u1.s, you'll see the sysent routine which handles syscalls. The numbering should be familiar :-)

    https://github.com/dspinellis/unix-history-repo/blob/Researc...

    If you go to 4.2BSD, you'll see many of these syscalls labeled as "old", e.g. "old pause", "old wait", "old break".

    https://github.com/dspinellis/unix-history-repo/blob/BSD-4_2...

    You can go a little further back to the original PDP7 assembly, but I don't believe the "kernel" actually ran on a separate "process" at all, and the userland simply linked into kernel symbols and called "read", "readdir" etc directly, hence why even later unix documentation tends to call these "routines" or "library calls".

  • rss-proxy

    RSS-proxy allows you to do create an RSS or ATOM feed of almost any website, just by analyzing just the static HTML structure.

  • I think it works fine, it makes a website of choice accessible for your Reader. Since it just maps HTML -> RSS the entry description can be sparse, but then your reader should grab the fulltext of the referenced site.

    There is basic JavaScript support [0], but this is rather new and not sure how well it works. I tested it with a couple of webapps and craigslist and it worked ok. If you host it on your pi, you can just run the big js-image.

    [0] https://github.com/damoeb/rss-proxy#javascript-support

  • pdp7-unix

    A project to resurrect Unix on the PDP-7 from a scan of the original assembly code

  • Well first of all I was wrong -- the PDP7 did have syscalls, I'm just bad at reading PDP7 assembly and missed the dispatcher. Curiously, it looks like the sequence is entirely different, although there could be some magic that makes the order different than it appears at first glance.

    https://github.com/DoctorWkt/pdp7-unix/blob/master/src/sys/s...

    It's all just guessing, but I figure the explanation is much simpler -- for PDP11 UNIX, they just kept using the same syscalls up till V7 / 2BSD, and there should have been a sort of "rolling release" binary compatibility. For the VAX, the first port (32v) probably just retained the original numbering since there was no reason to deviate from it, which colored 3BSD and 4BSD, hence {Net,Free,Open}BSD and Darwin and friends.

    Worth pointing out that several versions of Linux have rather different syscall tables. 32 bit ARM and x86 are more-or-less matches, with ARM differing on a few early syscalls, while 64 bit ARM and amd64 differing quite dramatically. The old ABI for 32bit MIPS also matches, but both the n32 and n64 ABIs use slightly variant syscall tables. PowerPC 32/64 bit is also a close match, although it has some impedance (I think it matches closer to AIX by design)

    At the end of the day, I think the similarity is mostly a mixture of coincidence, system developers being influenced by their bootstrap system's syscall tables, and no real reason to change them up. No reason to not change them, either, since it's pretty trivial to use different dispatch tables for different types of processes, like how the BSD's handle other-OS compat.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • F/OSS Comics: 8. The Origins of Unix and the C Language

    2 projects | news.ycombinator.com | 17 Apr 2024
  • Kernighan and Pike were right: Do one thing, and do it well

    2 projects | news.ycombinator.com | 19 Aug 2023
  • The original source code of the vi text editor, taken from System V

    4 projects | news.ycombinator.com | 12 Aug 2023
  • damoeb/rss-proxy - what is the 'outfacing URL'?

    1 project | /r/selfhosted | 28 May 2023
  • Continuous Unix commit history from 1970 until today

    1 project | news.ycombinator.com | 24 May 2023