Skip to content

Instantly share code, notes, and snippets.

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 / 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 / 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 / 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
@iankronquist
iankronquist / improvments.md
Last active September 2, 2015 21:03
Improvements to strings

Many of these should be bugs. I'm putting them here so I can keep them organized

  • Installing the gem
iankronquist@puppettop:(strings)(pr/54) → bundle exec gem build puppet-strings.gemspec 
WARNING:  no email specified
WARNING:  description and summary are identical
  Successfully built RubyGem
  Name: puppet-strings
  Version: 0.2.0
  File: puppet-strings-0.2.0.gem
@iankronquist
iankronquist / future prs.md
Last active August 29, 2015 14:27
Future prs

This is a collection of issues and features I would like to see added to various open source projects. They may or may not be worthwhile or desired by the project maintainers. Some are easy, some are hard.

http://ottomancuisine.com/2012/05/24/icli-kofte/

Ingredients:

  • 3 cups of fine grind bulgur (parboiled cracked wheat, you can find it in the organic food section of your supermarket or at Middle Eastern grocery shops) 500g of lean minced beef or lamb (ask your butcher to double grind it, it’s crucial)

  • 2 onions, finely grated

  • 1 whole egg