Skip to content

I wrote an HTTP server in ARM64 Assembly to have fun with some low-level stuff

Notifications You must be signed in to change notification settings

agu-z/asm-http-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asm-http-server

I wrote an HTTP server in ARM64 Assembly to have fun with some low-level stuff.

A gif recording demonstrating the server working

You can check out the code at server.s.

I'm talking to macOS directly through syscalls, which you're not supposed to do since, being a private API, they can change at any point. However, I did so anyway since I just wanted to explore the lowest level.

To prevent hardcoding all the constants needed to talk to the OS, I'm generating a const.s file from the C headers of the system lib. I cannot distribute binaries, but at least I should have better luck building it in the future.

Things I may do:

  • Use fork to handle many connections at once
  • Handle SIGINT to gracefully close the server
  • Send Content-Length

Running

On an Apple Silicon mac, run:

$ make

...and check out http://localhost:4520.

Resources

Some stuff that helped me get this working:

Also just running man <SYSCALL> can be super helpful. I wish we had something like that for modern stuff :)

About

I wrote an HTTP server in ARM64 Assembly to have fun with some low-level stuff

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published