RSSAmplifier

Blog

blog.pr4tt.com

Simon Pratt's blog

blog.pr4tt.comRSS feed ↗9 posts

Latest posts

goasm - a Go assembly generator

Recently, I’ve been learning Go . One thing I’ve learned is that the Go compiler generates its own assembly language . There’s a great talk by Rob Pike about it . While I was learning, I began to wish there was a tool similar to the Compiler Explorer (more commonly referred to as Godbolt) , but for Go assembly. So I built goasm, a Go assembly generator . Details The design is straightforward. It…

lc2.js - an LC-2 Simulator in JS

The book “Introduction to Computing Systems: from Bits & Gates to C & Beyond” by Patt & Patel introduces in some detail a computer called LC-2. This computer never physically existed, but the publisher’s website includes Windows and Unix versions of a simulator for the computer . I couldn’t get the Unix version to run on my system, and I didn’t want to dual-boot just for that, so I decided to…

Virtual Memory Differences

Previously, we’ve been looking at how POSIX specifies memory management , an academic design for virtual memory and BSD virtual memory in particular: BSD Virtual Memory OpenBSD Virtual Memory Next, let’s look at the differences between the virtual memory systems of NetBSD, OpenBSD, Linux, and OpenIndiana. History First, let’s give just a tiny summary of where each of these OSes come from. We…

OpenBSD Virtual Memory

Today, we answer the following questions about OpenBSD’s virtual memory system: How are contiguous regions of memory managed? How is memory freed? What happens when the kernel runs out of memory? Is there any special code for Non-Uniform Memory Access (NUMA) architectures? How is physical memory managed? Does it assume more virtual than physical memory? What are its data structures which store…

RadixVM

So far this blog has investigated the virtual memory interface in POSIX , and dived into some of the details of how it’s implemented in BSD . Today, we’ll look at the state of the art in academic virtual memory design, in particular a design called RadixVM by Austin T. Clements, M. Frans Kaashoek, Nickolai Zeldovich at MIT’s CSAIL . Background Recall that virtual memory allows us to pretend that…

BSD Virtual Memory

After the article on POSIX memory management , we have a good grasp of the high-level memory allocation functions specified in POSIX.1 . We learned how malloc is a C library function which can be implemented using mmap . Now it’s time to dive into the details about how mmap is implemented. Under the hood, mmap touches a fundamental concept in operating systems. Specifically, it must interface with…

POSIX Memory Management

As an application programmer using a unix-flavored operating system, one’s view of memory management is usually limited to malloc and its various alternative forms. However, malloc is part of the C standard library and while it is specified as part of POSIX.1 , the specification defers to the ISO C standard. In fact, since malloc is part of the C standard library it is not a part of the kernel and…

Possession, Ownership, and Copyright

Possession is the natural state of actually physically having some item. An item can only either be in your possession or not. Maybe there’s some ambiguity if several people are holding the same item, but we can say that everyone holds the item possesses it. The idea of possession comes naturally from being able to carry and use things. From the state of possession comes the natural rights to take…

Readability

If you’re reading this in a maximized browser on a wide-screen monitor, you may wonder why the margins are so big. The answer isn’t that this page is optimized for small displays. In fact, I asked the same question of LaTeX margins and I found an excellent answer on the LaTeX stackexchange that points out that the problem isn’t large margins, but large paper with respect to optimal line length.…