Giter VIP home page Giter VIP logo

clayne / 64bit-os-tutorial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gmarino2048/64bit-os-tutorial

0.0 0.0 0.0 141 KB

This OS Tutorial expands on the fundamental concepts covered in cfenollosa/os-tutorial and covers entering long mode on the x86_64 architecture. It also uses clang rather than relying on an external crosscompiler. I plan on keeping it up to date, so feel free to submit an issue!

License: MIT License

Shell 2.29% C 13.62% Assembly 82.78% Makefile 1.31%

64bit-os-tutorial's Introduction

MiniOS

Created by Guy Marino, Noah Houpt, and Steven Nyeo

How to Use This Tutorial

Hi everyone, this tutorial is meant to be an updated expansion on existing tutorials which focuses more on the 64-bit x86_64 architecture. It's not meant to be an introduction to C or Assembly, so you might want to learn those elsewhere first. We did our best to properly document everything, so if there's something you don't understand, then you might need to go back a few chapters.

  • Chapter 1 covers the initial boot process
  • Chapter 2 covers interfacing with the screen
  • Chapter 3 covers CPU errors and (eventually) hardware requests

It's not complete yet, but it's gotten to a point where we felt it could be helpful.

Who it's for

This tutorial is aimed at people who have a general understanding about C and Assembly, but are not necessarily computer experts. It's designed to be as accessible as possible, so it may feel at times like we over-explain some concepts (and that's okay). However, if you find yourself hopelessly lost please let us know. We created this project because we didn't like the gatekeeping seen in OS development, and we'd be happy to amend our explanations or point you to another resource that may be more helpful.

Contributing

If you'd like to contribute to this project, or add something of your own, please submit a pull request. I'll try to get to them all as soon as possible :)

What You'll Need

This tutorial uses the LLVM compiler suite, including clang and ld.lld. If you don't have those installed, you'll need to do so and add them to your path. We also use nasm for our assembler, and qemu-system-x86_64 as our emulator. Optionally, gdb can be used to debug kernel code. While not required, this tutorial uses shell scripts to make building and debugging easier. We strongly recommend that you have bash installed at /bin/bash (or at least symlinked there). If not, you can run the scripts using the bash command.

You should be able to run all of the above commands in a terminal window without specifying the full path. If you can't, you'll probably need to install them and add them to your path. This tutorial has been tested on macOS (Catalina and Big Sur) as well as Ubuntu (20.04). No other operating systems are officially supported, although it should run fine on most *nix machines.

NOTE: macOS gdb has difficulty with the debug symbols from the kernel (elf64). You may need to change the debug output level to -glldb in the Makefiles and use that instead, or build a new gdb from source.

That's it! No need to install any crosscompilers or other tools, since clang has most of it covered already. Best of luck, and if you have any trouble feel free to let us know!

64bit-os-tutorial's People

Contributors

0jk6 avatar gmarino2048 avatar limpingstone avatar

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.