Skip to content

Instantly share code, notes, and snippets.

@iankronquist
iankronquist / memory.md
Last active September 2, 2016 22:29
Design of the Kernel of Truth Memory System

Design of the Kernel of Truth Memory System

  • Uses PAE paging.
  • Higher half memory model.

Initialized in this order:

  1. Bootstrap PAE paging.
  2. Kernel heap.
  3. Physical allocator.
  4. Init process PAE paging.
00000000000000c0 <vmxoff>:
c0: e8 00 00 00 00 callq c5 <vmxoff+0x5>
c5: 55 push %rbp
c6: 48 89 e5 mov %rsp,%rbp
c9: 48 83 ec 10 sub $0x10,%rsp
cd: 65 48 8b 04 25 28 00 mov %gs:0x28,%rax
d4: 00 00
d6: 48 89 45 f8 mov %rax,-0x8(%rbp)
da: 31 c0 xor %eax,%eax
dc: 0f 01 c4 vmxoff

We're going to focus on x86 because it's the easiest to understand. I'll then explain how x86_64 is more efficient.

So the stack is where local variables are stored. It is just a chunk of memory available for the program. The top of the stack is stored in a special register called the stack pointer, or esp on x86. It grows from higher addresses to lower addresses. To put a value on the stack you can

@iankronquist
iankronquist / OSU CS444 Instructions.md
Last active May 19, 2016 18:09
Instructions for OSU CS444 assignment 3

You made a device driver! Let's say you named it sbd.

Let's start by recalling that on Linux, everything is a file. There is a file on the filesystem representing every device. On many linux laptops you can see things like /dev/mouse, /dev/speakers, and /dev/cpu. Your driver acts like a hard drive as far as Linux is concerned.

Now, if you start up the vm, you'll see that the device isn't loaded by default:

$ ls /dev/sbd
No such file or directory
@iankronquist
iankronquist / wlp3s0-eduroam
Created May 12, 2016 23:29
Eduroam configuration for netctl
Description='eduroam'
Interface=YOUR_INTERFACE
Connection=wireless
ESSID=eduroam
Security=wpa-configsection
IP=dhcp
TimeoutWPA=10
WPAConfigSection=(
'ssid="eduroam"'
'proto=RSN WPA'
#include <stdio.h>
#include <unistd.h>
int main () {
unsigned long long i;
while (1) {
printf("tick\n");
for (i = 1; i != 0; i++){}
}
}
@iankronquist
iankronquist / Resume.md
Last active January 4, 2016 21:28
Resume, as of 2014-01-28

Ian Kronquist

[iankronquist@teleport.com][1]
844 West Complex • Corvallis, Oregon 97331–1801
Github: [iankronquist][2] • IRC: muricula on Freenode

Enthusiastic and experienced student of computer science, enjoys solving the difficult problems which make the field fascinating. A quick learner eager to apply new concepts and technologies.

Education

@iankronquist
iankronquist / how-to-use-strings.md
Last active September 21, 2015 22:56
An Intro to Strings

Here is a quick intro for how to use strings for those not very familiar with puppet and the command line.

Setup

Do this once to get strings set up:

  1. Installing strings

$ puppet module install puppetlabs-strings

@iankronquist
iankronquist / fib.py
Created September 19, 2015 06:18
An example of testing in python
def fib (a, b, max ):
while (b < max):
tmp = a
a = b
b = a + b
return b
@iankronquist
iankronquist / registry_dump.json
Last active September 18, 2015 00:32
Structured data for strings
{
"defined_types": [
{
"docstring": "Docstring",
"file": "manifests/defined_type.pp",
"line": 6,
"name": "bar",
"parameters": {
"barname": null,
"barval": null