Tim's Notes

Welcome

How X.509 works

Introduce how X509 is used in web. Start from background knowledge: symmetric encryption asymmetric encryption hash function Then, outline workflow for digital signature. At the end, how public key certificate works among server side, CA, and client

How UEFI boot manager boots?

How UEFI boot manager know the boot order, and how to load corresponding OS? UEFI spec, chapter 3 – Boot Manager: The boot order list is read from a globally defined NVRAM variable. Below is my observation on my system, with tools: efibootmgr: manipulate the EFI Boot Manager efivar: UEFI environment variable interaction direct access…

PCI Bar example – C3000 SMBus

This article uses Intel Atom® Processor C3000 Product SMBus for example to demonstrate how base address registers (BAR) is used to access registers in I/O space. PCI header and BAR There are 6 BARs in configuration space header. 10-13 14-17 18-1B 1C-1F 20-23 24-27 C3000 – SMB BAR Let’s look into datasheet from Intel. This…

SOP of modifying ONIE source code

I would modify grep source code as example. Step Build first Modify file in build/<machine> make again, and verify stg export -d <dir> back to patch prepare patches and build again update ONIE 1) Build first 2) Modify code in build/<machine> In my example, machine is katana; therefore, codes are in build/katana-r0/.And I modify grep…

Debian – workflow

Step 1: clone and build Result: Step 2: change code Result: Step 3: change again Result:

How to prepare deb file

sudo apt-get install debhelper dh-virtualenv Refer to my projects: demo_dh_make debmake-helloword Reference: 制作DEB包的方法Debian Package Creation HowToHow to make a “Basic” .deb Debian New Maintainers’ Guide debmake: Guide for Debian Maintainers debmake: Chapter 4. Simple Example debmake man page Ubuntu Packaging Guide

Debian – 版本代號

debian 的代號名都來自於玩具總動員喔。 (from wiki) 發行版本 Debian主要分三個版本:穩定版本(stable)、測試版本(testing)、不穩定版本(unstable)。 目前的穩定版本為Debian Buster,上一個穩定版本是Stretch,不穩定版本永遠為Debian sid。到目前為止所有開發代號均出自Pixar的電影玩具總動員。 版本 代號 發布日期 玩具總動員 1.1 Buzz 1996年6月17日 巴斯光年,電影主角之一的太空人 1.2 Rex 1996年12月12日 暴龍 1.3 Bo 1997年6月2日 放羊的女孩「寶貝」 2.0 Hamm 1998年7月24日 小豬撲滿 2.1 Slink 1999年3月9日 玩具狗 2.2 Potato 2000年8月15日 Potato Head先生 3.0 Woody 2002年7月19日 胡迪,電影主角之一的牛仔 3.1 Sarge 2005年6月6日 綠色塑膠玩具士兵的首領「隊長」 4.0 Etch 2007年4月8日 玩具黑板 5.0 Lenny 2009年2月14日 望遠鏡 6.0…

SONiC – How are SONIC_MAKE_DEBS built?

Step Rule adds package into SONIC_MAKE_DEBS (ex: rules/bash.mk)(below steps are in slave.mk) remove debs in target/debs to force rebuild apply patches build project with make with setting DEST to target/debs remove patches of step 3

SONiC – How are SONIC_DPKG_DEBS built?

Steps Rule adds package into SONIC_DPKG_DEBS (ex: rules/gobgp.mk)(below steps are in slave.mk) remove old build logs apply patches build project with dpkg-buildpackage remove patches of step 3 move debs to target/debs

dpkg-buildpackage

dpkg-buildpackage is used to pack in deb format -r: use fakeboot to gain root permission -b: build binary -us: do not sign the source package -uc: do not sign the .changes file –target=<T>: call debian/rules T target after setup. Below is one example used in SONiC. After setting up this package, binary-syncd-rpc would be executed.…

Makefile – define, call, eval

Note: What add_derived_package returns is Makefile syntax, which should be executed. Pass this result to eval to run. If method return shell commands, there’s no need to eval. (Please refer to reference) Reference: 5.8 Defining Canned Recipes 8.7 The call Function 8.9 The eval Function 10.5.3 Automatic Variables Makefile cheatsheet [GNU Make] 函式 : 進階的使用者自訂函式 Testing the eval function…

Makefile – addprefix, static pattern rule

$(addprefix prefix,names…) $(addprefix prefix,names…) The argument names is regarded as a series of names, separated by whitespace; prefix is used as a unit. The value of prefix is prepended to the front of each individual name and the resulting larger names are concatenated with single spaces between them. For example, $(addprefix src/,foo bar) produces the result ‘src/foo src/bar’. Static Pattern Rules What’s meaning…

Hack – How SONiC builds?

We use below command to build SONiC image either for ONIE or EOS image. First, start reading Buildimage GuideBelow, I use marvell as example to see how image is built. slave.mk All rules/*.mk would be included, and it would be explained latter. SONIC_INSTALLERS CONFIGURED_PLATFORM would be marvell. As code snippet below, all mk files in…

Build SONiC for VS

VS stands for virtual switch, which is the platform you use to simulate NOS. I choose this revision just because it pass CI.

Reference – ACPI

[note] ACPI-Introduction.pdf [note] Watanabe, Takanori. “ACPI Implementation on FreeBSD.” USENIX Annual Technical Conference, FREENIX Track. 2002 Wysocki, Rafael J. “ACPI 6 and Linux.” (2015). [patent] Puthillathe, Chandrasekhar, and Sumanth Vidyadhara. “Out-of-band (OOB) real-time inventory and configuration of original equipment manufacturer (OEM) devices using advanced configuration and power interface (ACPI) and unified extensible firmware interface (UEFI)…

Driver – Platform, OF, ACPI

Platform driver can support both device tree and ACPI. Below use ipmi_si_platform.c as exapmle. Important structure: platform_driver of_match_table compatible: this is used to match device tree acpi_match_table id: this is used to match _HID from ACPI

Reference – PCIe

This book is quick good for acquiring basic and background context on PCIe. Wilen, Adam H., Justin P. Schade, and Ron Thornburg. “Introduction to PCI Express.” (2003).

科普 – Innovation Engine

Intel 裡面有一個元件 IE (innovation engine)可以放一個firmware進去,類似BMC的功能如果專案較為簡單,不用用到單獨的BMC的話,可以直接用他AMI, Insyde 也有提供相關的support

Relationship Between ACPI DSDT and Driver (IPMI as Example)

Get human readable format Differentiated System Description Table (DSDT) raw data can be found in Decompile it to human readable format (iasl -d) Wrap it up Use IPMI as exapmle Refer to: ipmi_si_platform.c DSDT.dsl ACPI spec DSDT.dsl snippet: Note that HID (IPI0001) is used to match driver Quote from ACPI spec Support of the IPMI…


Follow My Blog

Get new content delivered directly to your inbox.

Design a site like this with WordPress.com
Get started