OS-quick-abbreviation

OS-quick-abbreviation

Charles Lv7

通用缩写

本页单独撷取了部分极其常用的缩写及相关缩写片段

缩写 全称 备注
pa physical address
va virtual address
tf trap frame
asid address identifier
pgdir page_directory
off offset
ident identifier

IO 相关缩写对应表

缩写 全称 源文件 备注
outputk output (kernel) kern/printk.c
printk print (kernel) kern/printk.c
printcharc print char console include/drivers/console.h
scancharc scan char console include/drivers/console.h
fmt_callback_t format callback type include/print.h
vprintfmt variadic print format include/print.h

Elf 相关缩写对应表

Elf 全称为 Executable and Linkable Format ,在如下的缩写-全称对应中不做展开

ELF 数据类型相关缩写

缩写 全称 源文件 备注
Elf32_Half elf32 half word include/elf.h
Elf32_Sword elf32 signed word include/elf.h
Elf32_Xword elf32 extended word include/elf.h
Elf32_Sxword elf32 signed extended word include/elf.h
Elf32_Addr elf32 address include/elf.h
Elf32_Off elf32 offset include/elf.h
Elf32_Symndx elf32 symbol index include/elf.h

ELF Header结构体相关缩写

对于 elf 相关缩写,以 ‘e_’ 开头的常见缩写中 ‘e_’ 大部分表示 ‘elf’,由于篇幅限制,该类缩写部分省略

缩写 全称 源文件 备注
EI_NIDENT elf index number of identifier include/elf.h
e_phoff elf program offset include/elf.h Elf32_Ehdr 结构体成员
e_shoff elf section header offset include/elf.h Elf32_Ehdr 结构体成员
e_ehsize elf header size include/elf.h Elf32_Ehdr 结构体成员
e_phentsize elf program header table entry size include/elf.h Elf32_Ehdr 结构体成员
e_phnum elf program header table entry number include/elf.h Elf32_Ehdr 结构体成员
e_shentsize elf section header table entry size include/elf.h Elf32_Ehdr 结构体成员
e_shnum elf section header table entry number include/elf.h Elf32_Ehdr 结构体成员
e_shstrndx elf section header string table index include/elf.h Elf32_Ehdr 结构体成员
Elf32_Ehdr elf32 elf header include/elf.h
EI_MAG0 elf index magic 0 include/elf.h
ELFMAG0 elf magic 0 include/elf.h
EI_MAG1 elf index magic 1 include/elf.h
ELFMAG1 elf magic 1 include/elf.h
EI_MAG2 elf index magic 2 include/elf.h
ELFMAG2 elf magic 2 include/elf.h
EI_MAG3 elf index magic 3 include/elf.h
ELFMAG3 elf magic 3 include/elf.h

ELF Program Segment Header 结构体相关缩写

对于 elf 相关缩写,以 ‘p_’ 开头的常见缩写中 ‘p_’ 大部分表示 ‘program’ ,由于篇幅限制,该类缩写部分省略

缩写 全称 源文件 备注
p_vaddr program virtual address include/elf.h Elf32_Phdr 结构体成员
p_paddr program physical address include/elf.h Elf32_Phdr 结构体成员
p_filesz program file size include/elf.h Elf32_Phdr 结构体成员
p_memsz program memory size include/elf.h Elf32_Phdr 结构体成员
Elf32_Phdr elf32 program header include/elf.h

ELF 工具函数及宏相关缩写

缩写 全称 源文件 备注
elf_mapper_t elf mapper type include/elf.h
perm permission include/elf.h elf_mapper_t 函数指针形参
elf_load_seg elf load segment include/elf.h
ph program header include/elf.h elf_load_seg 函数形参
bin binary include/elf.h elf_load_seg 函数形参
ELF_FOREACH_PHDR_OFF elf for each program header offset include/elf.h
ph_off program header offset include/elf.h ELF_FOREACH_PHDR_OFF 宏参数
_ph_idx program header index include/elf.h ELF_FOREACH_PHDR_OFF 宏局部变量
bin_size binary file size lib/elfloader.c elf_load_seg 函数局部变量
sgsize segment size lib/elfloader.c elf_load_seg 函数局部变量

地址相关缩写对应表

缩写 全称 源文件 备注
KERNBASE kernel base include/mmu.h
KSTACKTOP kernel stack top include/mmu.h
ULIM user limit include/mmu.h
UVPT user virtual page table include/mmu.h
UPAGES user pages include/mmu.h
UENVS user envs include/mmu.h
UTOP user top include/mmu.h
UXSTACKTOP user exception stack top include/mmu.h
USTACKTOP user stack top include/mmu.h
UTEXT user text include/mmu.h
UCOW user copy on write include/mmu.h
UTEMP user temp include/mmu.h
PADDR physical address include/mmu.h
KADDR kernal address include/mmu.h
TRUP truncate user pointer include/mmu.h

内存管理相关缩写对应表

缩写 全称 源文件 备注
pp_ref physical page reference include/pmap.h Page 结构体成员
page2ppn page to physical page number include/pmap.h
pp physical page include/pmap.h page2ppn 函数形参
page2pa page to physical address include/pmap.h
pa2page physical address to page include/pmap.h
page2kva page to kernel virtual address include/pmap.h
va2page virtual address to page include/pmap.h
page_decref page decrease reference include/pmap.h
BY2PG bytes to per page include/mmu.h
PDMAP page directory map include/mmu.h
PGSHIFT page shift include/mmu.h
PDSHIFT page directory shift include/mmu.h
PDX page directory index include/mmu.h
PTX page table index include/mmu.h
PTE_ADDR page table entry address include/mmu.h
PPN physical page number include/mmu.h
VPN virtual page number include/mmu.h
PTE_G page table entry global include/mmu.h
PTE_V page table entry valid include/mmu.h
PTE_D page table entry dirty include/mmu.h
PTE_N page table entry uncacheable include/mmu.h
PTE_COW page table entry copy on write include/mmu.h
PTE_LIBRARY page table entry library include/mmu.h 实际上是共享页面的意思
npage number of page include/mmu.h
Pde page directory entry include/mmu.h
Pte page table entry include/mmu.h
freemem free memory kern/pmap.c
ppte pointer to page table entry kern/pmap.c pgdir_walk 函数形参
pgdir_entryp page directory entry pointer kern/pmap.c pgdir_walk 函数局部变量
fl free list kern/pmap.c physical_memory_manage_check 函数局部变量

进程控制相关缩写对应表

env 全称为 environment ,是本实验系统中的进程控制块,在如下的缩写-全称对应中不做展开

缩写 全称 源文件 备注
LOG2NENV log2 number of env include/env.h
NENV number of env include/env.h
ENVX env index include/env.h
curenv current env include/env.h
env_sched_list env schedule list include/env.h

错误相关缩写对应表

在本节中,E_ 开头表示 error ,在如下的缩写-全称对应中不做展开

对于各错误的详细含义,请参照代码中的注释加以理解。

缩写 全称 源文件 备注
E_INVAL E invalid parameter include/error.h
E_NO_MEM E no (more) memory include/error.h
E_NO_SYS E no(/invalid) system call include/error.h
E_NOT_EXEC E (file is) not executable include/error.h

基础数据类型相关缩写对应表

缩写 全称 源文件 备注
u_char unsigned char include/types.h
u_short unsigned short include/types.h
u_int unsigned int include/types.h
u_long unsigned long include/types.h

设备相关缩写对应表

dev 全称为 device,在如下的缩写-全称对应中不做展开。

在本节中,大量缩写经常作为其他缩写的一部分被反复使用,受限于篇幅,我们仅提取其中较为关键的部分予以说明。

console

缩写 全称 源文件 备注
cons console include/drivers/dev_cons.h 本文件中定义的四个宏不再做展开

ethernet

缩写 全称 源文件 备注
ether ethernet include/drivers/dev_ether.h
RX receive include/drivers/dev_fb.h
TX transmit include/drivers/dev_fb.h

framebuffer

缩写 全称 源文件 备注
fb framebuffer include/drivers/dev_fb.h
CTRL controller include/drivers/dev_fb.h

multiprocessor

缩写 全称 源文件 备注
mp multiprocessor include/drivers/dev_mp.h
WHOAMI who am I include/drivers/dev_mp.h
NCPUS number of CPUs include/drivers/dev_mp.h
IPI Inter-Processor Interrupt include/drivers/dev_mp.h 处理器间中断

Real-Time Clock

缩写 全称 源文件 备注
rtc real-time clock include/drivers/dev_rtc.h
SEC second include/drivers/dev_rtc.h
USEC user second include/drivers/dev_rtc.h
ACK acknowledge include/drivers/dev_rtc.h

系统调用相关缩写对应表

sys 全称为 system call,在如下的缩写-全称对应中不做展开

缩写 全称 源文件 备注
sys_print_cons sys print console kern/syscall_all.c
sys_mem_alloc sys memory alloc kern/syscall_all.c
sys_mem_map sys memory map kern/syscall_all.c
sys_mem_unmap sys memory unmap kern/syscall_all.c

用户缩写相关对应表

缩写 全称 源文件 备注
vpt virtual page table user/include/lib.h
vpd virtual page directory user/include/lib.h
ctemp copy temp user/lib/spawn.c init_stack 函数局部变量
pargv_ptr (to be) passed argument vector pointer user/lib/spawn.c init_stack 函数局部变量
spawnl spawn list user/lib/spawn.c
duppage duplicate page user/lib/fork.c
req request user/include/fsreq.h
fsreq file system request user/include/fsreq.h
ipc Inter-Process Communication user/lib/ipc.c 进程间通信
fsipc file system Inter-Process Communication user/lib/fsipc.c

文件相关缩写对应表

与文件相关的缩写数量较多,本节将按文件予以简单划分,具体含义请结合代码中注释及指导书进行理解

下表对文件相关缩写中的部分常用缩写单独列出,在如下的缩写-全称中不做展开

缩写 全称 备注
fs file system
fd file descriptor
ide Integrated Drive Electronics
stat status 指文件的相关信息

fs/ide.c

缩写 全称 源文件 备注
diskno disk number fs/ide.c ide_read 函数形参
secno sector number fs/ide.c ide_read 函数形参,表示起始扇区号
nsecs number of sectors fs/ide.c ide_read 函数形参,表示要读取的扇区数目

fs/fs.c

缩写 全称 源文件 备注
nbitmap number of bitmap fs/fs.c
diskaddr disk address fs/fs.c
blockno block number fs/fs.c diskaddr 函数形参

fs/serv.c

缩写 全称 源文件 备注
o_ff (struct open) file fd fs/serv.c Open 结构体成员
opentab open table fs/serv.c
REQVA request virtual address fs/serv.c

fs/serv.h

缩写 全称 源文件 备注
PTE_DIRTY page table entry dirty fs/serv.h 注意与PTE_D (可写权限位)区分
DISKNO disk number fs/serv.h
BY2SECT byte to sector fs/serv.h
SECT2BLK sector to block fs/serv.h

user/include/fs.h

缩写 全称 源文件 备注
BY2BLK byte to block user/include/fs.h
BIT2BLK bit to block user/include/fs.h
MAXNAMELEN max name length user/include/fs.h
MAXPATHLEN max path name length user/include/fs.h
NDIRECT number of direct user/include/fs.h
NINDIRECT number of indirect user/include/fs.h
BY2FILE byte to file user/include/fs.h
FILE2BLK file to block user/include/fs.h
FTYPE_REG file type regular file user/include/fs.h
FTYPE_DIR file type directory user/include/fs.h
FS_MAGIC file system magic user/include/fs.h
s_nblocks (struct super) number of blocks user/include/fs.h

user/include/fd.h

缩写 全称 源文件 备注
INDEX2FD index to fd user/include/fd.h
INDEX2DATA index to data user/include/fd.h
fd_omode (struct fd) open mode user/include/fd.h Fd 结构体成员
MAXFD max fd user/include/fd.h 最大文件描述符的数量
dev_stat device status user/include/fd.h Dev 结构体成员
st_isdir (struct stat) is directory user/include/fd.h Stat 结构体成员

user/lib/file.c

缩写 全称 源文件 备注
ffd file fd user/lib/file.c file_close 函数局部变量
ftruncate file truncate user/lib/file.c

user/lib/fd.c

缩写 全称 源文件 备注
fdno fd number user/lib/fd.c fd_alloc 函数局部变量
fdnum fd number user/lib/fd.c fd_lookup 函数形参
dup duplicate user/lib/fd.c
readn read n bytes user/lib/fd.c
fstat file status user/lib/fd.c
  • Title: OS-quick-abbreviation
  • Author: Charles
  • Created at : 2023-03-30 22:24:14
  • Updated at : 2023-11-05 21:36:18
  • Link: https://charles2530.github.io/2023/03/30/os-quick-abbreviation/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments