Skip to content

Instantly share code, notes, and snippets.

View itto-ki's full-sized avatar
🦀
Yo

Ittoh Kimura itto-ki

🦀
Yo
  • Tokyo, Japan
View GitHub Profile
" File: gtags.vim
" Author: Tama Communications Corporation
" Version: 0.6.8
" Last Modified: Nov 9, 2015
"
" Copyright and license
" ---------------------
" Copyright (c) 2004, 2008, 2010, 2011, 2012, 2014, 2015
" Tama Communications Corporation
"
# Basic Info
OS_NAME := SawayakanaOS
CUSTOM_TARGET := i386-sawayakanaos
# Commands
MAKE := make
LD_FLAG := -m elf_i386 -n
# Directories
set timeout=5
set default=0
menuentry "SawayaknaOS" {
multiboot2 /boot/sawayakanaos.bin
boot
}
# Basic Info
CUSTOM_TARGET := i386-sawayakanaos
# Directories
SRC_DIR := src
TARGET_DIR := target
DEBUG_BUILD_DIR := $(TARGET_DIR)/$(CUSTOM_TARGET)/debug/
# Files
SRCS := $(SRC_DIR)/lib.rs
#![feature(panic_implementation)]
#![no_std]
use core::panic::PanicInfo;
#[panic_implementation]
#[no_mangle]
pub extern "C" fn panic(_info: &PanicInfo) -> ! {
loop {}
}
{
"llvm-target": "i386-unknown-none",
"data-layout": "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128",
"arch": "x86",
"target-endian": "little",
"target-pointer-width": "32",
"target-c-int-width": "32",
"os": "none",
"executables": false,
"linker-flavor": "ld.lld",
[package]
name = "kernel"
version = "0.1.0"
authors = ["Ittoh Kimura <kimura.itto.kd3@gmail.com>"]
[dependencies]
[lib]
crate-type = ["staticlib"]
SECTIONS {
. = 1M;
.boot : { KEEP(*(.multiboot_header)) }
.text : { *(.text) }
}
NASM := nasm
NASM_FLAG := -f elf32
SRCS := $(wildcard *.S)
OBJS := $(patsubst %.S, %.o, $(SRCS))
.PHONY: build clean
build: $(OBJS)
@itto-ki
itto-ki / boot.S
Last active August 4, 2018 20:15
section .text
bits 32
extern kernel_main
boot:
call kernel_main
hlt