; Copyright 2016 Philipp Oppermann. See the README.md ; file at the top-level directory of this distribution. ; ; Licensed under the Apache License, Version 2.0 or the MIT license ; , at your ; option. This file may not be copied, modified, or distributed ; except according to those terms. global long_mode_start extern rust_main section .text bits 64 long_mode_start: ; load 0 into all data segment registers mov ax, 0 mov ss, ax mov ds, ax mov es, ax mov fs, ax mov gs, ax ; call rust main (with multiboot pointer in rdi) call rust_main .os_returned: ; rust main returned, print `OS returned!` mov rax, 0x4f724f204f534f4f mov [0xb8000], rax mov rax, 0x4f724f754f744f65 mov [0xb8008], rax mov rax, 0x4f214f644f654f6e mov [0xb8010], rax hlt