計算機核心學習

2021-08-31 01:15:47 字數 1938 閱讀 2239

前言:

核心的檔案樹如下所示:

編譯檔案如下:

# all phony targets

.phony : everything final image clean realclean disasm all buildimg

# default starting position

everything : $(tinixboot) $(tinixkernel)

all : realclean everything

final : all clean

image : final buildimg

clean :

rm -f $(objs)

realclean :

rm -f $(objs) $(tinixboot) $(tinixkernel)

disasm :

$(dasm) $(dasmflags) $(tinixkernel) > $(dasmoutput)

# write "boot.bin" & "loader.bin" into floppy image "tinix.img"

# we assume that "tinix.img" exists in current folder

buildimg :

dd if=boot/boot.bin of=tinix.img bs=512 count=1 conv=notrunc

mount tinix.img /mnt/floppy -o loop

cp -f boot/loader.bin /mnt/floppy/

cp -f kernel.bin /mnt/floppy

umount /mnt/floppy

boot/boot.bin : boot/boot.asm boot/include/load.inc boot/include/fat12hdr.inc

$(asm) $(asmbflags) -o $@ $<

boot/loader.bin : boot/loader.asm boot/include/load.inc boot/include/fat12hdr.inc boot/include/pm.inc

$(asm) $(asmbflags) -o $@ $<

$(tinixkernel) : $(objs)

$(ld) $(ldflags) -o $(tinixkernel) $(objs)

kernel/kernel.o : kernel/kernel.asm include/sconst.inc

$(asm) $(asmkflags) -o $@ $<

kernel/start.o: kernel/start.c include/type.h include/const.h include/protect.h include/string.h include/proc.h include/proto.h \

include/global.h

$(cc) $(cflags) -o $@ $<

image: realclean everything clean buildimg

realclean: 清空。 rm 中間產物 objs + 最後的三個產物

everything: 產生最後的三個產物 boot.bin loader.bin kernel.bin

clean:清空中間產物 objs

buildimg:

建立乙個 img 把 boot.bin 寫到 img 的前 512 位元組

用 mount 指令掛載 img

把 loader.bin kernel.bin 載入到掛載 img 所在目錄中

用 unmount 指令解掛載 img

計算機核心基礎

一 程式設計介紹 1.什麼是語言?什麼是程式語言?什麼是程式設計?什麼是程式?為何要有程式語言?語言的本質就是乙個事物與另乙個事物溝通的介質 表達方式。程式語言則是人與計算機之間溝通的介質 程式設計就是人把自己想命令計算機幹的事用程式語言翻譯出來並寫到檔案裡。存放有人類思維邏輯的 指令的檔案就是程式...

計算機核心基礎

一 程式語言 1.什麼是程式語言 程式語言是人與計算機之間溝通的介質 2.什麼是程式設計 程式設計是使用程式語言編寫一大堆的檔案 3.為什麼要程式設計 奴役計算機 解放勞動力 二 計算機五大組成部分 1.控制器 計算機的控制系統 控制硬體 2.運算器 邏輯運算和算術運算 3.儲存器 儲存系統 記憶體...

計算機核心刊物目錄

國核心心刊物目錄 計算機行業認定的一級刊物 核心刊物目錄 一 計算機類一級學術刊物 14種 1 軟體學報 是ei工程引文資料庫 期刊 2 j.of computer science technology 是ei工程引文資料庫 期刊 3 計算機學報 是ei工程引文資料庫 期刊 4 自動化學報 5 電子...