background preloader

Programming general

Facebook Twitter

Redis. Javascript in Ten Minutes (Javascript) Mldata :: Welcome. How to write a simple operating system in assembly language. (C) 2013 Mike Saunders and MikeOS Developers This document shows you how to write and build your first operating system in x86 assembly language. It explains what you need, the fundamentals of the PC boot process and assembly language, and how to take it further. The resulting OS will be very small (fitting into a bootloader) and have very few features, but it's a starting point for you to explore further. After you have read the guide, see the MikeOS project for a bigger x86 assembly language OS that you can explore to expand your skills.

Requirements Prior programming experience is essential. For this guide we're using Linux. Installing Linux is very easy thesedays; grab Ubuntu and install it in VMware or VirtualBox if you don't want to dual-boot. Sudo apt-get install build-essential qemu nasm This gets you the development toolchain (compiler etc.), QEMU PC emulator and the NASM assembler, which converts assembly language into raw machine code executable files. PC primer foo: db 0 Building. Low Level Bit Hacks You Absolutely Must Know. I decided to write an article about a thing that is second nature to embedded systems programmers - low level bit hacks. Bit hacks are ingenious little programming tricks that manipulate integers in a smart and efficient manner. Instead of performing some operation (such as counting the 1 bits in an integer) by looping over individual bits, these programming nuggets do the same with one or two carefully chosen bitwise operations.

To get things going I'll assume that you know what the two's complement binary representation of an integer is and also that you know all the the bitwise operations. I'll use the following notation for bitwise operations in the article: & - bitwise and | - bitwise or ^ - bitwise xor ~ - bitwise not << - bitwise shift left >> - bitwise shift right The numbers in the article are 8 bit signed integers (though the operations work on arbitrary length signed integers) that are represented as two's complement and they are usually named 'x'.

The result is usually 'y'. 1. Vi Cheat Sheet.

Python