Skip to content

Instantly share code, notes, and snippets.

Avatar

Kota UCHIDA uchan-nos

View GitHub Profile
@uchan-nos
uchan-nos / ring.c
Last active Mar 27, 2022
整数を要素とする固定長リングバッファの実装とテストケースのひな形
View ring.c
/*
セキュリティ・キャンプ 2022「OS 自作ゼミ」
応募課題 C のひな形ファイル
コンパイル&実行方法
$ gcc -Wall -Wextra ring.c
$ ./a.out
NG: want 2, got 0
NG: want 3, got 0
FAILED: 2/2 tests failed
@uchan-nos
uchan-nos / mycoroutine.cpp
Last active Sep 6, 2021
C++とアセンブラによるコルーチンの試験的実装
View mycoroutine.cpp
#include <array>
#include <chrono>
#include <cstring>
#include <iostream>
#include <thread>
using namespace std;
struct CoroContext {
uint64_t rip, rsp, rbp, rbx, r12, r13, r14, r15;
@uchan-nos
uchan-nos / comment_single-quote.s
Created Sep 3, 2021
strange behavior of 'as command' on M1 Mac
View comment_single-quote.s
mov x0, #1
LABEL1: # f
mov x0, #2
LABEL2: # '
mov x0, #3
LABEL3: # 'f
mov x0, #4
LABEL4: # 'fo
mov x0, #5
LABEL5: # 'foo
@uchan-nos
uchan-nos / brew_doctor_warnings.txt
Created Aug 24, 2021
brew doctor on My Mac mini (M1, 2020)
View brew_doctor_warnings.txt
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: gettext files detected at a system prefix.
These files can cause compilation and link failures, especially if they
are compiled with improper architectures. Consider removing these files:
/usr/local/lib/libgettextlib.dylib
/usr/local/lib/libintl.dylib
@uchan-nos
uchan-nos / v1-nested-for_bench.s
Last active Jun 1, 2021
Output of OpeLa Compiler Ver.1 and Ver.2
View v1-nested-for_bench.s
.intel_syntax noprefix
.code64
.section .text
.global main
main:
push rbp
mov rbp, rsp
sub rsp, 32
xor rax, rax
lea rax, [rbp-24]
@uchan-nos
uchan-nos / gpd-micropc-acpidump.txt
Created Apr 22, 2021
GPD MicroPC ACPI Dump(APCI PM Timerが無い機種)
View gpd-micropc-acpidump.txt
DBGP @ 0x008144010118FBE8
0000: 44 42 47 50 34 00 00 00 01 A9 49 4E 54 45 4C 20 DBGP4.....INTEL
0010: 47 4C 4B 2D 53 4F 43 20 03 00 00 00 42 52 58 54 GLK-SOC ....BRXT
0020: 0D 00 00 01 00 00 00 00 00 08 00 00 00 00 00 00 ................
0030: 00 00 00 00 ....
MCFG @ 0x008144010118FBE8
0000: 4D 43 46 47 3C 00 00 00 01 01 41 4C 41 53 4B 41 MCFG<.....ALASKA
0010: 41 20 4D 20 49 00 00 00 09 20 07 01 4D 53 46 54 A M I.... ..MSFT
0020: 97 00 00 00 00 00 00 00 00 00 00 00 00 00 00 E0 ................
@uchan-nos
uchan-nos / review-ext.rb
Created Dec 1, 2020
Re:VIEWでPDF生成時にだけダブルクオートを``と''に変換するインラインタグを定義する
View review-ext.rb
module ReVIEW
module LATEXBuilderOverride
Compiler.definline :dquote
def inline_dquote(s)
"``" + s + "''"
end
end
class LATEXBuilder
View rust_wasm_memo.md

Ubuntu 18.04

$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
$ rustup target add wasm32-unknown-unknown
$ sudo apt install libssl-dev
$ cargo install wasm-bindgen-cli
@uchan-nos
uchan-nos / _gvimrc
Created Oct 12, 2020
C++講習会で使っているGVim for Windowsの設定ファイル
View _gvimrc
set enc=utf-8
source $VIMRUNTIME/delmenu.vim
set langmenu=ja_jp.utf-8
source $VIMRUNTIME/menu.vim
colorscheme evening
set guifont=Myrica_M:h15
set guioptions-=T
set guioptions-=r
set guioptions-=R
@uchan-nos
uchan-nos / grep.cpp
Last active Apr 29, 2020
GPD MicroPC上のMikanOSでいくつかのコマンドが正常に実行できないバグを調査するメモ
View grep.cpp
#include <cstdio>
#include <cstdlib>
#include <regex>
#include "../syscall.h"
void DumpMem(uint64_t addr, int n) {
char s[128];
auto p = reinterpret_cast<volatile uint64_t*>(addr);
for (int i = 0; i < n - 1; i += 2) {
sprintf(s, "%016lx: %016lx %016lx\n",