Files
x86-bare-metal-examples/bios_detect_memory.S

30 lines
577 B
ArmAsm
Raw Normal View History

2015-10-20 21:00:24 +02:00
/*
# Detecte memory
# int 15
http://wiki.osdev.org/Detecting_Memory_%28x86%29
Determine how much memory you've got, and how much of it is low memory.
This is important in particular so that you can start your stack there
when you enter protected mode, since the stack grows down.
In 16-bit mode, it does not matter much,
since most modern machines have all addressable memory there.
`int 15` returns a list:
each time you call it a new memory region is returned.
## Low memory
TODO what is it?
*/
#include "common.h"
BEGIN
mov $0xE820, %eax
int $0x15
hlt