Operating system

Signal

mm fault handler

arch/powerpc/mm/fault.c
deatils of trap is in bad_page_fault

sigbus
__handle_mm_fault
{
hugetlb_fault CONFIG_HUGETLB_PAGE
handle_pte_fault->
{
do_linear_fault -> __do_fault
{
vma->vm_ops->fault(vma, &vmf);
}
do_anonymous_page
{
check_stack_guard_page
}
do_nonlinear_fault
do_swap_page
do_wp_page
{
vma->vm_ops->page_mkwrite(vma, &vmf); //??
}
}

kernel panic 3.10.62

kernel/panic.c
general protection fault and page fault
1498 errorentry general_protection do_general_protection
1499 errorentry page_fault do_page_fault
static const struct stacktrace_ops print_trace_ops = {
.stack = print_trace_stack,
.address = print_trace_address,
.walk_stack = print_context_stack,
};
no_context->
{
show_fault_oops->
__die->
{
print_modules
show_regs
{
printk(KERN_DEFAULT “Stack:\n”);
show_stack_log_lvl->
{
show_trace_log_lvl->
{
printk(“%sCall Trace:\n”, log_lvl);
// arch/x86/kernel/dumpstack_64.c
dump_trace->&print_trace_ops
}
}
printk(KERN_DEFAULT “Code: “);
}
}
}

Process and thread

Kernel mapping

tgid_base_stuff show_map_vma

GDB mapping

t->to_info_proc=procfs_info_proc
linux_info_proc not used in core dump
linux_core_info_proc_mappings this is correct

in kernel
fill_files_note

_IO_new_fopen
_IO_new_file_init
libio/fileops.c _IO_file_open
& _IO_file_jumps_maybe_mmap -> _IO_default_uflow -> _IO_file_underflow_maybe_mmap

libio/fileops.c: decide_maybe_mmap
We use the file in read-only mode. This could mean we can
mmap the file and use it without any copying. But not all
file descriptors are for mmap-able objects and on 32-bit
machines we don’t want to map files which are too large since
this would require too much virtual memory. */
__mmap64 (NULL, st.st_size, PROT_READ, MAP_SHARED, fp->_fileno, 0);

_IO_file_jumps_maybe_mmap
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_file_finish),
JUMP_INIT(overflow, _IO_file_overflow),
JUMP_INIT(underflow, _IO_file_underflow_maybe_mmap),
JUMP_INIT(uflow, _IO_default_uflow),
JUMP_INIT(pbackfail, _IO_default_pbackfail),
JUMP_INIT(xsputn, _IO_new_file_xsputn),
JUMP_INIT(xsgetn, _IO_file_xsgetn_maybe_mmap),
JUMP_INIT(seekoff, _IO_file_seekoff_maybe_mmap),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, (_IO_setbuf_t) _IO_file_setbuf_mmap),
JUMP_INIT(sync, _IO_new_file_sync),
JUMP_INIT(doallocate, _IO_file_doallocate),
JUMP_INIT(read, _IO_file_read),
JUMP_INIT(write, _IO_new_file_write),
JUMP_INIT(seek, _IO_file_seek),
JUMP_INIT(close, _IO_file_close),
JUMP_INIT(stat, _IO_file_stat),
JUMP_INIT(showmanyc, _IO_default_showmanyc),
JUMP_INIT(imbue, _IO_default_imbue)

_IO_file_jumps_mmap

_IO_file_jumps

我为什么不再做PL人

AI

从机器学习谈起

Resources of OS design

BrokenThorn Entertainment Operating System Development Series
Operating Systems: Three Easy Pieces

Unix/Linux programming

The Art of Unix Programming

Quantaties

Latency Numbers Every Programmer Should Know

Prof

Mort Yao 程序与证明

Compile and link

Pre-defined Compiler Macros
Gnu binutils docs
Welcome to GCC Wiki

Distributed system

CMU 15-640440
A Distributed Systems Reading List
The Game of Distributed Systems Programming. Which Level Are You?
From the Ground Up: Reasoning About Distributed Systems in the Real World
WHAT WE TALK ABOUT WHEN WE TALK ABOUT DISTRIBUTED SYSTEMS

Hack

Phrack
Obtain sys_call_table on amd64

Cognition

How does knowledge get locked up in people’s heads?

Process

How to Design Programs, Second Edition

Programming language

Learn Type Theory

Functional language

Functors, Applicatives, And Monads In Pictures

Programming

Programmer Competency Matrix
FB coding style
GNU Coding Standards
Google testing blog

Network

RAW PACKET FORMATS
从 IPv4 到 IPv6
What’s wrong with IPv4 and Why we are moving to IPv6

Improving Linux networking performance

Concurrency

Scalability Techniques for Practical Synchronization Primitives

English

英语口音纠正课程
英语思维漫谈
Pronunciation workshop
Conceptualizing English Language Systems

Memory

Recycling techniques

Kernel

走近Linux内核
为什么Linux内核不允许在中断中休眠
Linux Kernel Reading Guide
Unreliable Guide To Locking
Speeding up kernel development with QEMU
UBC: An Efficient Unified I/O and Memory Caching Subsystem for NetBSD
VFS notes

KVM

KVM源代码分析3:CPU虚拟化

Human, too human

Iyo Yoshimi 吉見衣世