Skip to content

Instantly share code, notes, and snippets.

View retrage's full-sized avatar
💭
🦄

Akira Moroo retrage

💭
🦄
View GitHub Profile
@retrage
retrage / draw_bitmap.py
Last active January 6, 2016 12:13
This script converts an image to arduino functions using u8glib.
#!/usr/bin/python
# -*- coding: utf-8 -*-
from PIL import Image
import sys
funccall_tmp = "u8g.drawBitmapP({0}, {1}, 1, 8, {2});"
def draw(px, width, height):
funcs = list()
@retrage
retrage / freebsd_dmesg_on_azure
Created March 8, 2016 04:33
dmesg of FreeBSD 10.2 on Microsoft Azure
Copyright (c) 1992-2015 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 15:26:37 UTC 2015
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
CPU: Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz (1212.09-MHz K8-class CPU)
Origin="GenuineIntel" Id=0x306f2 Family=0x6 Model=0x3f Stepping=2
Features=0xf83fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE,SSE2,SS>
@retrage
retrage / amd64-reg.patch
Last active July 4, 2016 08:44
Fix NetBSD de(4) problem on Hyper-V
Index: amd64/include/i82093reg.h
===================================================================
RCS file: /cvs/cvsroot/src/sys/arch/amd64/include/i82093reg.h,v
retrieving revision 1.5
diff -u -r1.5 i82093reg.h
--- amd64/include/i82093reg.h 3 Jul 2008 14:02:25 -0000 1.5
+++ amd64/include/i82093reg.h 4 Jul 2016 08:45:00 -0000
@@ -50,6 +50,7 @@
movq IOAPIC_SC_DATA(%rdi),%r15 ;\
movl (%r15),%esi ;\
@retrage
retrage / higashi_gyoen_json.py
Created October 5, 2016 17:47
Generating json from Kokyo Higashi-Gyoen Hanadayori
#!/usr/bin/python
# -*- coding: utf-8 -*-
from urllib import request
from urllib import error
from bs4 import BeautifulSoup
import json
from datetime import datetime
def fetch_data(url):
This file has been truncated, but you can view the full file.
@a = common global i32 0, align 4
@b = common global i32 0, align 4
@c = common global i32 0, align 4
@d = common global i32 0, align 4
@bp = common global i32 0, align 4
@sp = common global i32 0, align 4
@pc = common global i32 0, align 4
@mem = common global [16777216 x i32] zeroinitializer, align 16
define void @func0() {
This file has been truncated, but you can view the full file.
; ModuleID = '8cc.c.eir.ll'
source_filename = "8cc.c.eir.ll"
@a = common local_unnamed_addr global i32 0, align 4
@b = common local_unnamed_addr global i32 0, align 4
@c = common local_unnamed_addr global i32 0, align 4
@d = common local_unnamed_addr global i32 0, align 4
@bp = common local_unnamed_addr global i32 0, align 4
@sp = common local_unnamed_addr global i32 0, align 4
@pc = common local_unnamed_addr global i32 0, align 4
This file has been truncated, but you can view the full file.
.text
.file "8cc.c.eir.ll.opt.ll"
.globl func0
.type func0,@function
func0: # @func0
.local i32, i32, i32, i32, i32, i32, i32, i32
# BB#0:
block
i32.const $push8252=, 0
i32.load $push8251=, pc($pop8252)
@retrage
retrage / pe.c
Created March 28, 2017 15:27
Portable Executable Dumper
#include "pe.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/mman.h>
diff --git a/sys/arch/amd64/conf/HYPERV b/sys/arch/amd64/conf/HYPERV
new file mode 100644
index 0000000..47f378fc
--- /dev/null
+++ b/sys/arch/amd64/conf/HYPERV
@@ -0,0 +1,1328 @@
+# $NetBSD: GENERIC,v 1.433 2016/05/14 17:11:30 christos Exp $
+#
+# GENERIC machine description file
+#
@retrage
retrage / hyperv-WIP.diff
Created April 6, 2017 13:09
WIP diff file for importing FreeBSD's hyper-V driver to NetBSD
diff --git a/.gitignore b/.gitignore
index 1631e83..98c40f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
+*.bash
obj/*
tools/*/obj/*
sys/arch/amd64/compile/HYPERV/*
+sys/arch/amd64/compile/HVMON/*