some stuff, mostly copied from osdev wiki