<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Linuxカーネル on Debimate</title><link>https://debimate.jp/categories/linux%E3%82%AB%E3%83%BC%E3%83%8D%E3%83%AB/</link><description>Recent content in Linuxカーネル on Debimate</description><image><title>Debimate</title><url>https://debimate.jp/images/default-ogp.jpg</url><link>https://debimate.jp/images/default-ogp.jpg</link></image><generator>Hugo -- 0.161.1</generator><language>ja-JP</language><lastBuildDate>Mon, 15 Jul 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://debimate.jp/categories/linux%E3%82%AB%E3%83%BC%E3%83%8D%E3%83%AB/index.xml" rel="self" type="application/rss+xml"/><item><title>Linux Kernel Tree内で自作Kernelモジュールをビルドする方法(MakefileとKconfigの書き方)</title><link>https://debimate.jp/post/ja/2019-07-15-linux-kernel-tree%E5%86%85%E3%81%A7%E8%87%AA%E4%BD%9Ckernel%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%82%92%E3%83%93%E3%83%AB%E3%83%89%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95makefile%E3%81%A8kconfi/</link><pubDate>Mon, 15 Jul 2019 00:00:00 +0000</pubDate><guid>https://debimate.jp/post/ja/2019-07-15-linux-kernel-tree%E5%86%85%E3%81%A7%E8%87%AA%E4%BD%9Ckernel%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%82%92%E3%83%93%E3%83%AB%E3%83%89%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95makefile%E3%81%A8kconfi/</guid><description>&lt;h3 id="前書き"&gt;前書き&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://debimate.jp/post/2019-01-27-%E7%92%B0%E5%A2%83%E6%A7%8B%E7%AF%89-linux-kernel%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%81%AE%E4%BD%9C%E6%88%90%E6%BA%96%E5%82%99/"&gt;過去の記事(環境構築: Linux Kernelモジュールの作成準備)&lt;/a&gt;では、&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Linux Kernelソースコード&lt;/li&gt;
&lt;li&gt;自作Kernelモジュール&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;を分離して管理していました。ディレクトリ構成は、以下のような状態です。&lt;/p&gt;</description></item><item><title>Linux Kernel: mutex APIによるロック(排他)方法</title><link>https://debimate.jp/post/ja/2019-07-07-linux-kernel-mutex-api%E3%81%AB%E3%82%88%E3%82%8B%E3%83%AD%E3%83%83%E3%82%AF%E6%8E%92%E4%BB%96%E6%96%B9%E6%B3%95/</link><pubDate>Sun, 07 Jul 2019 00:00:00 +0000</pubDate><guid>https://debimate.jp/post/ja/2019-07-07-linux-kernel-mutex-api%E3%81%AB%E3%82%88%E3%82%8B%E3%83%AD%E3%83%83%E3%82%AF%E6%8E%92%E4%BB%96%E6%96%B9%E6%B3%95/</guid><description>&lt;h3 id="前書きmutexとは"&gt;前書き：mutexとは&lt;/h3&gt;
&lt;p&gt;Linux Kernelに限らず、様々なプログラミング言語やライブラリはロック機構を提供しています。ロック機構は、複数のプロセスが同時に共有データを書き換え、意図しないデータ状態となる事を防ぎます。代表的なロック機構には、&lt;/p&gt;</description></item><item><title>Linux Kernelの簡単なCharacter Deviceを作成する方法(Linked List APIの使用方法サンプル)</title><link>https://debimate.jp/post/ja/2019-06-23-linux-kernel%E3%81%AE%E7%B0%A1%E5%8D%98%E3%81%AAcharacter-device%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95linked-list-api%E3%81%AE%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95%E3%82%B5/</link><pubDate>Sun, 23 Jun 2019 00:00:00 +0000</pubDate><guid>https://debimate.jp/post/ja/2019-06-23-linux-kernel%E3%81%AE%E7%B0%A1%E5%8D%98%E3%81%AAcharacter-device%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95linked-list-api%E3%81%AE%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95%E3%82%B5/</guid><description>&lt;h3 id="前書き"&gt;前書き&lt;/h3&gt;
&lt;p&gt;本記事では、Linux KernelにおけるCharacter Device向けのDevice Driverを作成する方法を示します。専用のHardware(例：シリアルデバイスのUARTなど)を用いず、メモリ上のデータ読み書きのみを行います。そのため、擬似デバイス(/dev/nullや/dev/zeroなど)を操作するDriverと同等です。&lt;/p&gt;</description></item><item><title>Linux Kernel: __initマクロ、__exitマクロの役割(メモリの有効利用)</title><link>https://debimate.jp/post/ja/2019-04-29-linux-kernel-__init%E3%83%9E%E3%82%AF%E3%83%AD__exit%E3%83%9E%E3%82%AF%E3%83%AD%E3%81%AE%E5%BD%B9%E5%89%B2%E3%83%A1%E3%83%A2%E3%83%AA%E3%81%AE%E6%9C%89%E5%8A%B9%E5%88%A9%E7%94%A8/</link><pubDate>Mon, 29 Apr 2019 00:00:00 +0000</pubDate><guid>https://debimate.jp/post/ja/2019-04-29-linux-kernel-__init%E3%83%9E%E3%82%AF%E3%83%AD__exit%E3%83%9E%E3%82%AF%E3%83%AD%E3%81%AE%E5%BD%B9%E5%89%B2%E3%83%A1%E3%83%A2%E3%83%AA%E3%81%AE%E6%9C%89%E5%8A%B9%E5%88%A9%E7%94%A8/</guid><description>&lt;h3 id="__initマクロ__exitマクロが使われるケース"&gt;__initマクロ、__exitマクロが使われるケース&lt;/h3&gt;
&lt;p&gt;一般的に、__initマクロはKernelモジュールの初期化時、__exitマクロはKernelモジュールの終了時に付与します。以下の例では、初期化関数がdebimate_init()、終了関数がdebimate_exit()で、それぞれにマクロを付与しています。&lt;/p&gt;</description></item><item><title>Linux Kernel: List構造を操作するためのAPI(Listの使い方)</title><link>https://debimate.jp/post/ja/2019-04-07-linux-kernel-list%E6%A7%8B%E9%80%A0%E3%82%92%E6%93%8D%E4%BD%9C%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AEapilist%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9/</link><pubDate>Sun, 07 Apr 2019 00:00:00 +0000</pubDate><guid>https://debimate.jp/post/ja/2019-04-07-linux-kernel-list%E6%A7%8B%E9%80%A0%E3%82%92%E6%93%8D%E4%BD%9C%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AEapilist%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9/</guid><description>&lt;h3 id="前書き"&gt;前書き&lt;/h3&gt;
&lt;p&gt;C言語は、言語としてList構造およびList操作APIをサポートしていません。ここでのList構造とは、「次のデータ(前のデータ)へのポインタ」を意味します。本記事では、データとList構造(nextポインタ、prevポインタ)をセットにした状態をノードと呼びます。&lt;/p&gt;</description></item><item><title>Linux Kernel: 構造体メンバポインタから構造体の先頭ポインタを得るcontainer_ofマクロ</title><link>https://debimate.jp/post/ja/2019-04-06-linux-kernel-%E6%A7%8B%E9%80%A0%E4%BD%93%E3%83%A1%E3%83%B3%E3%83%90%E3%83%9D%E3%82%A4%E3%83%B3%E3%82%BF%E3%81%8B%E3%82%89%E6%A7%8B%E9%80%A0%E4%BD%93%E3%81%AE%E5%85%88%E9%A0%AD%E3%83%9D%E3%82%A4/</link><pubDate>Sat, 06 Apr 2019 00:00:00 +0000</pubDate><guid>https://debimate.jp/post/ja/2019-04-06-linux-kernel-%E6%A7%8B%E9%80%A0%E4%BD%93%E3%83%A1%E3%83%B3%E3%83%90%E3%83%9D%E3%82%A4%E3%83%B3%E3%82%BF%E3%81%8B%E3%82%89%E6%A7%8B%E9%80%A0%E4%BD%93%E3%81%AE%E5%85%88%E9%A0%AD%E3%83%9D%E3%82%A4/</guid><description>&lt;h3 id="container_ofマクロとは"&gt;container_ofマクロとは&lt;/h3&gt;
&lt;p&gt;container_ofマクロは、Linux Kernelで用いられ、「構造体メンバポインタ」から「そのメンバを含む構造体の先頭ポインタ」を得られるマクロです。C言語では、&lt;a href="http://www.c-tipsref.com/reference/stddef/offsetof.html"&gt;offsetofマクロ&lt;/a&gt;によって構造体メンバアドレスのオフセット(構造体先頭アドレスからメンバ変数までのオフセット)を算出できます。container_ofマクロは、このオフセットを利用し、構造体の先頭アドレスを算出しています。&lt;/p&gt;</description></item><item><title>Linux Kernel: NULLポインタエラーハンドリング(ERR_PTR, IS_ERR, PTR_ERR)</title><link>https://debimate.jp/post/ja/2019-03-02-linux-kernel-null%E3%83%9D%E3%82%A4%E3%83%B3%E3%82%BF%E3%82%A8%E3%83%A9%E3%83%BC%E3%83%8F%E3%83%B3%E3%83%89%E3%83%AA%E3%83%B3%E3%82%B0err_ptr-is_err-ptr_err/</link><pubDate>Sat, 02 Mar 2019 00:00:00 +0000</pubDate><guid>https://debimate.jp/post/ja/2019-03-02-linux-kernel-null%E3%83%9D%E3%82%A4%E3%83%B3%E3%82%BF%E3%82%A8%E3%83%A9%E3%83%BC%E3%83%8F%E3%83%B3%E3%83%89%E3%83%AA%E3%83%B3%E3%82%B0err_ptr-is_err-ptr_err/</guid><description>&lt;h3 id="返り値がnull--情報量がない"&gt;&amp;ldquo;返り値がNULL&amp;rdquo; = &amp;ldquo;情報量がない&amp;rdquo;&lt;/h3&gt;
&lt;p&gt;C言語には、返り値としてポインタを返す関数があります。&lt;/p&gt;
&lt;p&gt;User空間の関数で例を挙げれば、メモリを確保するmalloc()、ファイルを開くfopen()などです。これらの関数は、エラー時にNULLを返します。&lt;/p&gt;</description></item><item><title>Linux Kernel: エラー番号の一覧</title><link>https://debimate.jp/post/ja/2019-02-24-linux-kernel-%E3%82%A8%E3%83%A9%E3%83%BC%E7%95%AA%E5%8F%B7%E3%81%AE%E4%B8%80%E8%A6%A7/</link><pubDate>Sun, 24 Feb 2019 00:00:00 +0000</pubDate><guid>https://debimate.jp/post/ja/2019-02-24-linux-kernel-%E3%82%A8%E3%83%A9%E3%83%BC%E7%95%AA%E5%8F%B7%E3%81%AE%E4%B8%80%E8%A6%A7/</guid><description>&lt;h3 id="前書き"&gt;前書き&lt;/h3&gt;
&lt;p&gt;本記事では、Linux Kernelが用いるエラー番号を説明します。&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id="linux-kernelがエラー番号errnoを正しく返す意義"&gt;Linux Kernelがエラー番号（errno）を正しく返す意義&lt;/h3&gt;
&lt;p&gt;Linux Kernelでは、エラーの種類に応じて、返すべきエラー番号が定められています。例えば、ファイルが存在しない場合は、&amp;ldquo;ENOENT(No such file or directory、 エラー番号2)&amp;ldquo;を返します。Linux Kernel内のエラー内容は、変数errnoを通してUser空間にも伝わります。&lt;/p&gt;</description></item><item><title>Linux Kernel: prink(print kernel)によるメッセージ出力</title><link>https://debimate.jp/post/ja/2019-02-02-linux-kernel-prinkprint-kernel%E3%81%AB%E3%82%88%E3%82%8B%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E5%87%BA%E5%8A%9B/</link><pubDate>Sat, 02 Feb 2019 00:00:00 +0000</pubDate><guid>https://debimate.jp/post/ja/2019-02-02-linux-kernel-prinkprint-kernel%E3%81%AB%E3%82%88%E3%82%8B%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E5%87%BA%E5%8A%9B/</guid><description>&lt;h3 id="printkとは"&gt;printk()とは&lt;/h3&gt;
&lt;p&gt;printk(print kernel)は、ユーザ空間のprintf( print formatted )に相当します。注意すべき点として、printf()と以下の点が異なります。本記事では、この差異を説明します。&lt;/p&gt;</description></item><item><title>環境構築: Linux Kernelモジュールの作成準備</title><link>https://debimate.jp/post/ja/2019-01-27-%E7%92%B0%E5%A2%83%E6%A7%8B%E7%AF%89-linux-kernel%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%81%AE%E4%BD%9C%E6%88%90%E6%BA%96%E5%82%99/</link><pubDate>Sun, 27 Jan 2019 00:00:00 +0000</pubDate><guid>https://debimate.jp/post/ja/2019-01-27-%E7%92%B0%E5%A2%83%E6%A7%8B%E7%AF%89-linux-kernel%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%81%AE%E4%BD%9C%E6%88%90%E6%BA%96%E5%82%99/</guid><description>&lt;h3 id="前書き"&gt;前書き&lt;/h3&gt;
&lt;p&gt;本記事は、「Linux Kernel Device Driverの雛形作成」や「Linux Kernel内APIを試すためのモジュール作成」を目的として、最低限必要な環境構築手順を記載しています。&lt;/p&gt;</description></item><item><title>Raspberry Pi3(Linux Kernel)のBoot Sequence Step1:アーキテクチャ依存部</title><link>https://debimate.jp/post/ja/2018-12-31-raspberry-pi3linux-kernel%E3%81%AEboot-sequence-step1%E3%82%A2%E3%83%BC%E3%82%AD%E3%83%86%E3%82%AF%E3%83%81%E3%83%A3%E4%BE%9D%E5%AD%98%E9%83%A8/</link><pubDate>Mon, 31 Dec 2018 00:00:00 +0000</pubDate><guid>https://debimate.jp/post/ja/2018-12-31-raspberry-pi3linux-kernel%E3%81%AEboot-sequence-step1%E3%82%A2%E3%83%BC%E3%82%AD%E3%83%86%E3%82%AF%E3%83%81%E3%83%A3%E4%BE%9D%E5%AD%98%E9%83%A8/</guid><description>&lt;h3 id="前書き"&gt;前書き&lt;/h3&gt;
&lt;p&gt;シングルボードコンピュータの&lt;a href="https://www.raspberrypi.org/"&gt;Raspberry Pi3&lt;/a&gt;を用いて、&lt;a href="https://www.kernel.org/"&gt;Linux Kernel&lt;/a&gt;のBoot Sequenceを調査します。その調査結果を複数回に分けて、記事にします。対象のLinux Kernelは、&lt;a href="https://github.com/raspberrypi/linux"&gt;Raspberry Pi(OS)のソースコード rpi-4.1.y&lt;/a&gt;とします。&lt;/p&gt;</description></item></channel></rss>