硬件和程序员的约定

CPU Reset 后寄存器会有确定的初始状态

  • EIP = 0x0000fff0
  • CR0 = 0x60000010
    • 处理器处于 16-bit 模式
  • EFLAGS = 0x00000002
    • interrupt disabled

Reset 后处理器从固定地址(Reset Vector)启动

  • MIPS: 0xbfc000000
    • Specification 规定
  • ARM: 0x00000000
    • Specification 规定
    • 允许配置 Reset Vector Base Address Register
  • RISC-V: Implementation defined
    • 给厂商最大程度的自由

The Convention Between Hardware and Programmers

After CPU Reset, registers have well-defined initial states

  • EIP = 0x0000fff0
  • CR0 = 0x60000010
    • The processor is in 16-bit mode
  • EFLAGS = 0x00000002
    • interrupt disabled

After Reset, the processor starts from a fixed address (the Reset Vector)

  • MIPS: 0xbfc000000
    • Specified by the Specification
  • ARM: 0x00000000
    • Specified by the Specification
    • Allows configuring the Reset Vector Base Address Register
  • RISC-V: Implementation defined
    • Gives vendors maximum freedom
C/C++WikiLinux

最小的 C 程序

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <sys/syscall.h>

.globl _start
_start:
movq $SYS_write, %rax // write(
movq $1, %rdi // fd=1,
movq $st, %rsi // buf=st,
movq $(ed - st), %rdx // count=ed-st
syscall // );

movq $SYS_exit, %rax // exit(
movq $1, %rdi // status=1
syscall // );

st:
.ascii "\033[01;31mHello, OS World\033[0m\n"
ed:

:这段代码是什么意思?

The Smallest C Program

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <sys/syscall.h>

.globl _start
_start:
movq $SYS_write, %rax // write(
movq $1, %rdi // fd=1,
movq $st, %rsi // buf=st,
movq $(ed - st), %rdx // count=ed-st
syscall // );

movq $SYS_exit, %rax // exit(
movq $1, %rdi // status=1
syscall // );

st:
.ascii "\033[01;31mHello, OS World\033[0m\n"
ed:

Q: What does this piece of code mean?

C/C++WikiLinux

今天开始开启了人生新阶段,从学生身份转变为社会人儿了。

也从 3 年的 CVer 即将变成 Coder 了。

3 年的 CV 生涯可以说是毫无建树,希望在未来的两年能够有所收获,成为一名工程师。

码农界流传着一种说法,想要获得长足的发展,基础一定要牢固。所以我决定花半年左右的时间学习《操作系统》这门课程,至于为什么是操作系统,因为 jyywiki.cn 的教程制作精良,不学有些可惜了。

本系列的博客主要为 jyywiki.cn 的示例代码作笔记,以便于加深印象。

Today marks the beginning of a new chapter in my life, transitioning from a student to a member of the working world.

I’m also about to go from a CVer of 3 years to a Coder.

My 3 years of CV research can hardly be said to have accomplished anything. I hope to gain something in the next two years and become an engineer.

There’s a saying among coders: to achieve long-term growth, you must have a solid foundation. So I’ve decided to spend about half a year studying the Operating Systems course. Why operating systems? Because the tutorials on jyywiki.cn are so well-made that it would be a shame not to study them.

This blog series mainly serves as notes on the example code from jyywiki.cn, to help deepen my understanding.

C/C++WikiLinux

前言

考虑到硬盘空间不使用是一种极大的浪费现象,为了提高磁盘空间的利用率,想要存储更多学习资料在里面,抖音上有铺天盖地的小姐姐教我们跳舞,是极好的学习资源库。因此,出于学习目的,就想要把她们的学习资料保存到我的本地空间,免得哪一天她们被封了我想看也看不到学也学不到了。

Preface

Considering that leaving disk space unused is a huge waste, and in order to improve the utilization of disk space and store more study materials in it — Douyin is full of young ladies teaching us how to dance, making it an excellent learning resource library. Therefore, for study purposes, I wanted to save their study materials to my local space, lest they get banned one day and I can no longer watch learn from them.

阅读更多
Wiki教程Python

再见

Goodbye

结绳记事

关于 Rclone

Rclone是一个命令行程序,用于管理云存储上的文件。它是云服务商网页存储界面的功能丰富的替代品。超过40种云存储产品支持rclone,包括S3对象存储、企业和消费者文件存储服务,以及标准传输协议。

Rclone具有强大的云存储等效程序,类似于Unix命令rsync、cp、mv、mount、ls、ncdu、tree、rm和cat。Rclone的语法非常熟悉,并支持shell管道和–dry-run保护。它可以通过命令行、脚本或其API使用。

用户称 rclone 为“云存储的瑞士军刀”和“难以分辨的魔术技术”。

About Rclone

Rclone is a command-line program to manage files on cloud storage. It is a feature-rich alternative to the web storage interfaces of cloud service providers. Over 40 cloud storage products support rclone, including S3 object storage, business and consumer file storage services, as well as standard transfer protocols.

Rclone has powerful cloud equivalents to the unix commands rsync, cp, mv, mount, ls, ncdu, tree, rm and cat. Rclone’s syntax is very familiar and supports shell piping and --dry-run protection. It can be used via the command line, scripts, or its API.

Users call rclone “The Swiss army knife of cloud storage” and “Technology indistinguishable from magic”.

WikiLinux教程

Death is not the end of life, forgetting is the end of life.
死亡并不是生命的终点,遗忘才是。

Death is not the end of life, forgetting is the end of life.
Death is not the end of life; forgetting is the end of life.

结绳记事