1 ; meinOS - A unix-like x86 microkernel operating system
2 ; Copyright (C) 2008 Janosch Gräf <janosch.graef@gmx.net>
4 ; This program is free software: you can redistribute it and/or modify
5 ; it under the terms of the GNU General Public License as published by
6 ; the Free Software Foundation, either version 3 of the License, or
7 ; (at your option) any later version.
9 ; This program is distributed in the hope that it will be useful,
10 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ; GNU General Public License for more details.
14 ; You should have received a copy of the GNU General Public License
15 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
22 ; setting up the Multiboot header - see GRUB docs for details
28 MST_FLAGS
equ 0000000000000000b
29 OPT_FLAGS
equ 0000000000000110b
30 FLAGS
equ (MST_FLAGS
<<16)|OPT_FLAGS
31 MAGIC
equ 0x1BADB002 ; 'magic number' lets bootloader find the header
32 CHECKSUM
equ -(MAGIC
+ FLAGS
) ; checksum required
34 VIDEOMODE
equ 0 ; Textmode
35 VIDEOWIDTH
equ 80 ; 80 Cols
36 VIDEOHEIGHT
equ 25 ; 25 Lines
37 VIDEODEPTH
equ 0 ; Depth
38 ; reserve initial kernel stack space
45 dd MAGIC
; Magic number
47 dd CHECKSUM
; Checksum
48 times
5 dd 0 ; unused fields
49 dd VIDEOMODE
; Videomode
50 dd VIDEOWIDTH
; Videowidth
51 dd VIDEOHEIGHT
; Videoheight
52 dd VIDEODEPTH
; Videodepth
55 mov esp, init_stack
+STACKSIZE
-4 ; set up the stack
57 push eax ; pass Multiboot magic number
58 push ebx ; pass Multiboot info structure
59 call main
; call kernel function
62 cli ; halt machine should kernel return
65 init_stacksize
dd STACKSIZE