Code Monkey home page Code Monkey logo

asm-http-server's Introduction

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 :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.