Implementing the FAT32 file system with Rust

FAT file system knowledge overview A file is, in fact, data. Data is represented in the computer as 0/1, and the most basic unit is the bit. 8 bit = 1 Byte, 1024 Byte = 1 KB, 1024 KB = 1 MB, and so on. The content of a file is also a combination of several 01 strings. When reading/writing a file, we call the functions read()/write() in the kernel,

io_uring Reading Notes

io_uring in a nutshell There are two important operations for asynchronous requests for io_uring: committing the request, and completing the submitted request. For IO event submission, the application is the producer and the kernel is the consumer, while for completion events, the kernel is the producer and the application is the consumer. Therefore, we need a pair of rings to provide a high-performance channel for communication between the kernel and

RISC -V N Extensions

Added CSRs User status register (ustatus) 1 2 3 4 5 UXLEN-1 5 4 3 1 0 ┌────────┬──────┬──────┬─────┐ │ WPRI │ UPIE │ WPRI │ UIE │ └────────┴──────┴──────┴─────┘ UXLEN-5 1 3 1 ustatus is a UXLEN bit-long read/write register that records and controls the current operating status of the hardware thread. User-state interrupts are disabled when the user-state interrupt enable bit UIE is zero. In order to provide atomicity to the user-state fall-in handler, the value in UIE is copied to UPIE when a user-state interrupt occurs, and UIE is set to zero.

KPTI mechanism in xv6-riscv

KPTI in a Nutshell The KPTI (Kernel Page Table Isolation) mechanism was originally designed to mitigate KASLR bypass and CPU-side channel attacks. In the KPTI mechanism, the isolation of memory in kernel state space from user state space has been further enhanced. The page table in the kernel state includes the page table of user-space memory and the page table of kernel-space memory. The page table in the user state includes only the page table of user space memory and the page table of kernel space memory as necessary, such as the memory used for handling system calls, interrupts, and other information.

WebSocket, HTTP/2 and gRPC

I. WebSocket WebSocket is a two-way communication protocol that uses the HTTP/1.1 protocol in the handshake phase (HTTP/2 is not supported at this time). The handshake process is as follows. First the client initiates a special HTTP request to the server with the following message header. 1 2 3 4 5 6 7 8 GET /chat HTTP/1.1 // 请求行 Host: server.example.com Upgrade: websocket // required Connection: Upgrade //

OpenSUSE Usage Guide

openSUSE is an RPM-based distribution, which is in line with RHEL/CentOS. But its official package manager is a proprietary zypper, which works quite well, and the software is quite new. I recently switched from Manjaro to openSUSE and found that the KDE desktop is indeed smoother than Manjaro and the community source OBS experience is more comfortable than AUR. Especially for containers/Kubernetes, the source is richer than AUR and is

Ali's own standardized protocol library XQUIC officially open source!

Open Source Address : https://github.com/alibaba/xquic What is XQUIC? XQUIC is Ali’s self-developed IETF QUIC standardized transport protocol library.XQUIC is a UDP transport framework implemented based on the IETF QUIC protocol, including encrypted reliable transmission, HTTP/3 two main blocks, to provide applications with reliable, secure and efficient data transmission capabilities, which can greatly improve the user network experience of products in weak and mobile networks. This technology research and development is initiated and led by the Taobao platform technology team, and currently there are several teams participating in it, such as Dharma Institute XG Lab and AliCloud CDN.

QEMU-KVM Virtualization Environment Construction and Use

QEMU/KVM Virtualization QEMU/KVM is currently the most popular virtualization technology. It is based on the kvm module provided by the Linux kernel, with a streamlined structure, low performance loss, and is open source and free (compared to the paid vmware), so it has become the preferred virtualization solution for most enterprises. The current virtualization solutions of major cloud vendors are basically using KVM technology for new server instances. Even AWS,

Introduction, installation and use of the secrets management tool Vault

Vault is a secrets management, encryption-as-a-service and privilege management tool from hashicorp. Its features are briefly described as follows. secrets management: support for saving various custom information, automatic generation of various types of keys, vault automatically generated keys can also be automatically rotated (rotate) authentication: support access to major cloud vendors’ account systems (such as the Aliyun RAM sub-account system) or LDAP, etc. for authentication, without creating additional account systems.

Installation, usage and personal experience with Argo Workflows, the cloud-native pipeline

Note: This article is not an introductory tutorial, to learn Argo Workflows please go to the official documentation Argo Documentation Argo Workflows is a cloud-native workflow engine that focuses on orchestrating parallel tasks. It has the following features. defines workflows using Kubernetes Custom Resources (CR), where each step in a workflow is a container. model multi-step workflows as a series of tasks, or use directed acyclic graphs (DAGs) to describe

The Swiss Army knife of Linux networking tools - socat & netcat

The commands in this article were tested on macOS Big Sur and Opensuse Tumbleweed socat & netcat netcat (network cat) is a long-established network toolkit, known as the Swiss Army knife of TCP/IP. All major Linux distributions have the openbsd version of netcat installed by default, and its command line name is nc . And socat (socket cat), which is officially described as "netcat++" (extended design, new implementation), is a

Virtual Network Interface in Linux

Note: Any network configuration created or modified with the ip command in this article is not persistent and disappears upon host reboot. Linux has powerful virtual networking capabilities, which are the basis for virtual networks such as openstack networks, docker container networks, and kubernetes networks. Here are the most common types of virtual network interfaces for Linux: TUN/TAP, bridge, veth, ipvlan/macvlan, vlan, and vxlan/geneve. I. tun/tap Virtual Network Interface tun/tap

Iptables And Docker Container Network Analysis

This article is only for ipv4 networks This article first introduces the basic concept and common commands of iptables, and then analyzes how docker/podman is a standalone container network implemented with iptables and Linux virtual network interface. iptables iptables provides packet filtering, NAT and other packet handling capabilities. iptables is most used in firewall and NAT scenarios. Both iptables and the new nftables are based on netfilter and are subprojects

The difference between Ctrl+C and Kill to kill a process

On linux systems, you can kill processes by typing <Ctrl+C> in bash or by using the command kill -9 $pid, but they are very different. Let’s put the conclusion first: kill command will only kill the target process, while bash shortcut will kill the whole foreground process group! linux process killing methods Regardless of the method used, killing processes is done by sending a signal. The kill command actually sends a signal to the target pid process.

Rust Ownership and Borrowing

Study notes, benchmarking cpp to understand the concept of rust ownership and borrowing, and mentioning the more specific slice (DST) by the way Ownership Each value in rust has an owner variable and can only have one owner at the same time. When the value’s owner variable goes out of scope, the value’s memory is freed. The following code String has moved ownership from s1 to s2 and a Move

Go Reflection: Chunking slices to a specified size

In the process of writing code, sometimes we need to do some bulk queries/operations, which often involve chunking a large array or slice. For example, if we have an array of ids and we want to request an interface to query information based on the ids, the interface supports batch queries, but the maximum number of queries per query is 100. the best practice is to take up to 100 ids from the array each time and do a batch query until the array is traversed.

Android/iOS determine whether to use a proxy or VPN

For the black industry of APP, we mentioned that some users will bypass the wind control strategy by changing IP. A more convenient way to change IP is to use proxy IP or VPN. In testing APP security is required to make a judgment on whether to use the code and VPN. The following is a compilation of some codes for reference. Android determine whether to use proxy IP 1

Stitching images to video using ffmpeg

This article describes how to use ffmpeg to stitch a large number of images into a video, and introduces the meaning of some of the parameters. Before using ffmpeg to stitch images into a video, you need to pre-process the image file name, the file name must have a number to mark out its order, here I directly renamed the image using numbers, as follows. Directly use the command ffmpeg

Prevent HTTPS from exposing the domain name bound on the server

When we use CDN services such as CloudFlare, in addition to the function of saving traffic and speeding up access, an important function is to prevent exposing the real IP of the website, but if your NGINX is not properly configured, direct access to the server’s IP using the HTTPS protocol will expose a certificate pointing to a domain name on the server, which will be scanned by some Some services that scan the entire network for IP addresses get the correspondence between the domain name and the IP.

Big Data Fundamentals: Hadoop

This first article was organized in 2014, in this 7~8 years time, Hadoop has changed a lot, but the most core content has not changed so much, the article at that time still has some reference significance. Once again, we will re-do the organization. An overview of Hadoop Hadoop, a distributed system infrastructure, was developed by the Apache Foundation. Users can develop distributed programs without understanding the underlying details of distribution.