發表文章

目前顯示的是 2016的文章

jenkins: 建置基本的 C/C++ project

圖片
記錄一下,如何在ubuntu使用jerkins建置基本的C\C++ project, 以及相關的plugin. 以下用github上面的VIM project來作為一個範例. 編譯設定 新增完一個FreeStyle的project之後, source management部分選擇git, 並填入https://github.com/vim/vim.git 如下圖, 並在build部份新增script指令 ./configure make Plugin設定 Cppcheck 作用: 針對C/C++的code分析 套件: 系統需安裝cppcheck, jerkins需安裝CppCheck Plugin 在build設定那邊,新增執行cppcheck的script指令. 接著再Post-build Actions新增Publish Cppcheck results. 輸入的檔案名稱需跟script所產生的xml名稱相同. (這邊我預設檔案是存放在$WORKSPACE底下) cppcheck --xml --xml-version=2 --enable=all --inconclusive --language=c++ *.cpp $WORKSPACE 2> $WORKSPACE/cppcheck.xml Compile warning 作用: 針對編譯過程中產生的訊息進行分析 套件: jerkins需安裝Warnings Plug-in Post-build Actions新增Scan for compiler warnings, 這邊選擇你所用的編譯器類型即可. Task Scanner Plug-in 作用: 掃描程式中的TODO,FIXME或@deprecated 套件: jerkins需安裝 Task Scanner Plug-in Post-build Actions新增Scan workspace for open tasks, 再填入相對的關鍵字即可 Reference [1] Jenkins for C++: tools and plugin configuration [2] 使用Jenkins打造.Net CI S

PC Booting 簡介

基於 BIOS 的開機流程簡介 描述基於 linux 的開機流程步驟, 適用於有 BIOS 的機器 開機的時候會執行 BIOS, BIOS 先對硬體做檢測. 在根據設定所指定的開機 device 去讀取 MBR(Master Boot Record). MBR 處於 device 的第一個 sector, 裡面包含了基本的 boot loader 與 partition table 資訊. 礙於 MBR 大小的限制(512 bytes = 446(basic boot loader code, e.g. boot.img) + 64(partition table)), boot loader 的會再去其他 sector 讀取完整的 boot loader 程式(e.g. core.img). 程式依據 MBR 或 GPT 來判斷放 boot loader 的位置[3][4]. (1) 為MBR時候, 通常 boot loader 安裝於 MBR 與第一個 partition 之間. (2) 當為GPT, 則使用一個 Boot Partition 來存放 boot loader 當 boot loader 被執行後, 會去讀取 /boot/grub 裡面的設定來決定所要讀取的 OS 核心檔案 (kernel.img 和 initrd.img) initrd.img 裡面包含 kernel 所需的基本模組(mod), 當被掛載後 kernel 便可以去讀取外接裝置, 並視設定來決定是否有需要重掛載檔案系統 接著就執行第一支程式 e.g. initd or systemd 範例 範例1 [6] Stage 1 : boot.img is stored in the master boot record (MBR) or optionally in any of the volume boot records (VBRs), and addresses the next stage by an LBA48 address (thus, the 1024-cylinder limitation of GRUB legacy is avoided); at installation time it is