Skip to content

Instantly share code, notes, and snippets.

View knknkn1162's full-sized avatar

Kenta Nakajima knknkn1162

View GitHub Profile
struct bio {
sector_t bi_sector;
struct bio *bi_next; /* request queue link */
struct block_device *bi_bdev;
unsigned long bi_flags; /* status, command, etc */
unsigned long bi_rw; /* bottom bits READ/WRITE, top bits priority
* top bits priority
*/
unsigned short bi_vcnt; /* how many bio_vec's */
$ tree /dev
/dev
|-- MAKEDEV -> /sbin/MAKEDEV
|-- VolGroup00
| |-- LogVol00 -> /dev/mapper/VolGroup00-LogVol00
| `-- LogVol01 -> /dev/mapper/VolGroup00-LogVol01
|-- X0R -> null
|-- console # register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console"
|-- core -> /proc/kcore
|-- cpu_dma_latency
import /app/tensorflow/.tf_configure.bazelrc
@knknkn1162
knknkn1162 / special_rootfs.yml
Last active May 10, 2019 04:16
How to configure special root filesystem on boot( c.f) Understanding the Linux Kernel 2.6.11)
# start_kernel() -> vfs_caches_init() -> mnt_init() -> init_rootfs, init_mount_tree の中身
- init_rootfs(): register_filesystem(&rootfs_fs_type); append (struct file_system)rootfs_fs_type global variable to (struct file_system*)file_systems.
- find_filesystem("rootfs") and return the end of `(struct file_system*)file_systems`
- append (struct file_system)rootfs_fs_type to the previous result
- init_mount_tree: create `struct vfsmount` element
- vfsmount = do_kern_mount(fstype="rootfs", flags=0, name="rootfs", data=NULL)
- get_fs_type("rootfs"): get (struct file_system*)rootfs_fs_type
- vfsmount = alloc_vfsmnt("rootfs"): allocate&initialize `struct vfsmount` element
- vfsmount = kmem_cache_alloc(mnt_cache, GFP_KERNEL): allocate `struct vfsmount`
- initialize vfsmount->mnt_list: (later, link to `namespace.list` as the head)
// include/linux/kmalloc_sizes.h
#if (PAGE_SIZE == 4096)
CACHE(32)
#endif
CACHE(64)
#if L1_CACHE_BYTES < 64
CACHE(96)
#endif
CACHE(128)
#if L1_CACHE_BYTES < 128
# Assume that
## DEBIAN=/usr/local/lib/lxc/debian01
## ROOTFS=${DEBIAN}/rootfs
$ tail -n +1 ${DEBIAN}/config ${ROOTFS}/etc/inittab ${ROOTFS}/etc/network/interfaces ${ROOTFS}/etc/hostname
==> /usr/local/lib/lxc/debian01/config <==
lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up
lxc.tty = 4
lxc.pts = 1024
We can't make this file beautiful and searchable because it's too large.
AssetsAbstract 資産の部
AssetsAbstract_2 資産の部 [タイトル項目]
CurrentAssetsAbstract 流動資産
CurrentAssetsAbstract_2 流動資産 [タイトル項目]
CashAndDeposits 現金及び預金
CashAndDeposits_2 現金預金
CashAndDeposits_3 現金・預金
CashAndDeposits_4 現金・預金
CashAndDeposits_5 現金及び預金
NotesAndAccountsReceivableTrade 受取手形及び売掛金
% curl -sL http://resource.ufocatch.com/xbrl/edinet/ED2016062902417/S1007ZVB/XBRL/PublicDoc/jpcrp030000-asr-001_E04499-000_2016-03-31_01_2016-06-29.xbrl | xmllint --xpath "//@contextRef" - | tr ' ' '\n'| sed 's/^.*"\(.*\)".*$/\1/' | sort | uniq -c
1
181 CurrentYearDuration
1 CurrentYearDuration_CapitalStockMember
3 CurrentYearDuration_CapitalSurplusMember
2 CurrentYearDuration_DeferredGainsOrLossesOnHedgesMember
2 CurrentYearDuration_ForeignCurrencyTranslationAdjustmentMember
92 CurrentYearDuration_NonConsolidatedMember
1 CurrentYearDuration_NonConsolidatedMember_CapitalStockMember
2 CurrentYearDuration_NonConsolidatedMember_DeferredGainsOrLossesOnHedgesMember
@knknkn1162
knknkn1162 / fsm_sample.vhdl
Created November 5, 2018 03:27
fsm for testbench
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity fsm_sample_tb is
end entity;
architecture behavior of fsm_sample_tb is
component fsm_sample is
port (
clk, rst : in std_logic;