<commit_before>#[test]
fn it_works() {
}<commit_msg>use os_std to start the os: allocate memory and print some test values + add some interrupt handlers<commit_after>#![no_std]
#![feature(globs, phase, asm)]

extern crate rlibc;
extern crate "os_std" as std;
#[phase(plugin)] extern crate "os_std" as std; //macros

pub use std::prelude::*;

extern {
    static kernel_end_symbol_table_entry: ();
    //static kernel_start_symbol_table_entry: ();
}

#[no_mangle]
pub fn main(multiboot: *const std::multiboot::Information) {

    unsafe{std::init(&kernel_end_symbol_table_entry as *const (), multiboot)};
    unsafe{asm!("sti")};
    let x = box 5i;

    let y = 0xb8000 as *mut u64;
    unsafe{*y = 0xffffffffffffffff};

    print!("test");
    print!("test\n");
    println!("newline {}", x);

    loop {
        panic!("end of os!");
        // Add code here
    }
}


/* Interrupt Handlers */

#[no_mangle]
pub extern "C" fn interrupt_handler(interrupt_number: u64, error_code: u64, rsp:u64) -> u64 {
    match interrupt_number {
        13 if error_code != 0 => panic!(
            "General Protection Fault: Segment error at segment 0x{:x}", error_code),
        32 => {},
        33 => print!("k"),
        _ => panic!("unknown interrupt! number: {}, error_code: {:x}",interrupt_number, error_code),
    };

    rsp
}

#[no_mangle]
pub extern "C" fn pagefault_handler(address: u64, error_code: u64, rsp:u64) -> u64 {
    panic!("page fault: address: {}, error_code: {}, rsp: {}", address, error_code, rsp);
}
{'fraction_non_alphanumeric': 0.15984147952443858, 'fraction_numerical': 0.021796565389696168, 'mean_word_length': 3.6904024767801857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3564102', 'n_tokens_mistral': 547, 'n_tokens_neox': 520, 'n_words': 138}