Skip to content

Instantly share code, notes, and snippets.

@agrif
agrif / jobs.py
Created December 11, 2011 21:51
import multiprocessing
import itertools
import Queue
from signals import Signal
##
## first, some generic interfaces
##
#!/bin/bash
set -e
# this is mostly copied from arch-chroot
BASE="$(realpath $(dirname "$0"))"
LFS="$BASE/root"
die() {
printf "ERROR: "
@agrif
agrif / rgba-glx.c
Created December 16, 2012 01:58
MacSlow's ARGB GLX visuals demo, archived here because the original site is down :(
/*******************************************************************************
**3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
** 10 20 30 40 50 60 70 80
**
** program:
** rgba-glx
**
** author:
** Mirco "MacSlow" Mueller <macslow@bangang.de>
**
@agrif
agrif / Makefile
Last active May 4, 2023 04:50
a horrible, horrible, wonderful C Preprocessor hack library
OBJECTS = cobalt.o co-new.o co-iterate.o co-range.o test.o
TARGET = test
CFLAGS = -Wall -Werror -std=gnu99
.PHONY : all clean
all : ${TARGET}
clean :
rm -f ${TARGET} ${OBJECTS}
#![no_std]
#![no_main]
use panic_halt as _;
use stm32f1xx_hal::{pac, prelude::*, rcc, usb};
use usb_device::prelude::*;
use usbd_serial::{SerialPort, USB_CLASS_CDC};
#[cortex_m_rt::entry]
Bluegrass Kitchen Sink
Run `help` to list commands.
> help
Main
====
help show this help text
test run the built-in test
EEMBC CoreMark
@agrif
agrif / README.md
Last active September 6, 2022 07:32
my current ipxe setup

All of this should go into a directory that is available via HTTP and NFS. In variables.ipxe you can provide the HTTP root and NFS root paths, which are used later. Also there are some variables to set the default iscsi root (without the last part after the colon) and the initiator iqn. These are used to auto-fill the iscsi menu options.

You should tell iPXE to boot bootstrap.ipxe.

The bootstrap process reads a bunch of files and sets a bunch of variables. Of importance, it will read the file macs/XXXXXXX.ipxe

/* calibration table generated 2022-03-21T15:12:26.123655
table represented within tolerance 0.1% by 46 points
capacity: 12.57 Ah
138.89 Wh
100% | ~~~~~
| ~~
| ~
// find the segmented address of STAGE3_ENTRY
// be careful: rust *really* wants to optimize STAGE3_ENTRY into a u16
// in the resulting binary
let mut buf_address: u32;
unsafe {
core::arch::asm!(
"mov {1}, {0}",
in(reg) STAGE3_ENTRY,
out(reg) buf_address,
);
#![no_std]
#![no_main]
#![feature(asm_sym)]
#![feature(naked_functions)]
use blue_loader_stage3::{realmode, realmode_asm};
extern "sysv64" {
static REALMODE_IMAGE: &'static [u8];
static mut REALMODE: &'static mut [u8];