uchan note

プログラミングや電子工作の話題を書きます

x86-64 モードのプログラミングではスタックのアライメントに気を付けよう

x86-64 モードというのは x86 系 CPU の動作モードの一つです.64 ビットモードとかロングモードと呼ばれることもあります. x86-64 モードではページングが必須だったり,セグメント CS や DS に設定するベースアドレスやリミットが無視されるなど,CPU 自体の制約事項もあります. それ以外に,x86-64 モードでよく使われる ABI による制約もあり,ハマりやすい部分でもあるので本記事で説明します.

続きを読む

How to reset NVRAM of MinnowBoard Turbot

This article expresses how to reset a NVRAM of a MinnowBoard Turbot. MinnowBoard Turbot is a x86_64 board for embedded use.

Why this article is useful

Enabling fast boot in BIOS setup utility will block you to enter to the utility again. You can re-enter to it by resetting NVRAM on the board.

How to reset NVRAM

0. Prerequisite

You'll need a jumper connector to short-circuit two pins.

f:id:uchan_nos:20180109074238j:plain

1. Short-circuit two J7 pins

J7 (Jumper 7) pins are the upper right of the board.

f:id:uchan_nos:20180109074002j:plain

Connect two pins using a jumper connector.

f:id:uchan_nos:20180109074131j:plain

2. Boot up

Boot the board up and hit DELETE key repeatedly. Then your BIOS settings are reset and you should be able to get into BIOS setup utility.

3. Finish

Shut down the board and remove the jumper connector.

レガシー BIOS が 2020 年で消えたあとの世界

11 月に入って,Intel が 2020 年までにレガシー BIOS サポートを完全に消そうとしているというニュースが飛び込んできました.

www.itmedia.co.jp

OS を自作する場合はいまだに BIOS に頼った起動コードを書くことが多いと思います. このニュースが意味する正確なところを少し解説した後,レガシー BIOS がなくなった後の世界を自作 OS の視点から考えてみます.

自作 OS Advent Calendar 2017 5 日目の記事です.

続きを読む

mdadm の write-intent bitmap と bad block log を競合させてみる

本記事は Linux Advent Calendar 2017 の 4 日目の記事です.

概要

Linux のソフトウェア RAID の機能を管理するための mdadm コマンドにまつわるバグの再現実験を行います. そのバグとは,次の記事で紹介されている「バグ 1」のことです.

blog.cybozu.io

続きを読む

はてなブログで画像タグが展開されないバグの検証テスト記事

画像タグを張りつける条件によってはタグが展開されないことを確認するテスト.以下の画像をサンプルとして使う

f:id:uchan_nos:20171126114150p:plain:w100

スペースによるコードブロック

の後だとなぜか展開されない.

[f:id:uchan_nos:20171126114150p:plain:w100]

2枚貼っても展開されない.

[f:id:uchan_nos:20171126114150p:plain:w100]

バッククオートによるコードブロック

を書くことによって展開動作が復活する.

f:id:uchan_nos:20171126114150p:plain:w100

※この挙動が治ってしまうと記事が意味不明になるので,治る前の様子をスクショしました.

f:id:uchan_nos:20171126114558p:plain:w100