This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Loads a PRU text.bin (and optionally data.bin) file, | |
// executes it, and waits for completion. | |
// | |
// Usage: | |
// $ ./loader text.bin [data.bin] | |
// | |
// Compile with: | |
// gcc -o loader loader.c -lprussdrv | |
// | |
// Based on https://credentiality2.blogspot.com/2015/09/beaglebone-pru-gpio-example.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Crack Xerox Alto disk passwords using math. | |
import sys | |
def findPasswd(passvec): | |
# a and b are the salt values | |
a = (passvec[1] << 16) + passvec[2] | |
b = (passvec[3] << 16) + passvec[4] | |
if a == 0 or b == 0: | |
print 'No password' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job prime1.s | |
* Compute primes 2-255 for toggle challenge | |
* Ken Shirriff http://righto.com | |
ctl 6641 | |
org 201 * Start of print buffer | |
num dcw 002 * Current number | |
org 333 * Start of code memory | |
outer mcw @002@, factor * Start with factor 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job card.s | |
ctl 6641 | |
org 087 | |
X1 dcw 000 * Index 1, pointer to text | |
dc 00 | |
org 333 | |
start sw 1 | |
sbr x1, buf+80 | |
rloop r * Read cards into page buffer | |
bce rhs, 1, - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Process font file to generate FPGA code | |
# Font from https://github.com/dhepper/font8x8/blob/master/font8x8_basic.h | |
import re | |
chars = [] | |
for line in open('font8x8_basic.h').readlines(): | |
m = re.search('{([\s0-9A-Fa-fx,]*)}', line) | |
if m: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Process font file to generate FPGA code | |
# Font from https://github.com/dhepper/font8x8/blob/master/font8x8_basic.h | |
import re | |
chars = [] | |
for line in open('font8x8_basic.h').readlines(): | |
m = re.search('{([\s0-9A-Fa-fx,]*)}', line) | |
if m: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable password protection on an Alto disk by zeroing out the password flag in sys.boot | |
import sys | |
import subprocess | |
diskContents = None | |
# Get word at the word offset in the disk file | |
def getWord(wordOffset): | |
return ord(diskContents[2 * wordOffset]) + ord(diskContents[2 * wordOffset + 1]) * 256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (bit_count = 0; bit_count < 8; bit_count++) { | |
if (byte & 0x80) { | |
wait_for_pwm_timer(); | |
__R30 = HIGH << WRITE_PIN; | |
wait_for_pwm_timer(); | |
__R30 = LOW << WRITE_PIN; | |
} else { | |
wait_for_pwm_timer(); | |
__R30 = LOW << WRITE_PIN; | |
wait_for_pwm_timer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
data="""\ | |
10100001 10010011 01100011 => 01110111 | |
10100001 10010011 01100100 => 01110001 | |
10100001 10010011 01100101 => 01110000 | |
10100001 10010011 01100110 => 01110010 | |
10100001 10010011 01100111 => 01110011 | |
10100001 10010011 01101000 => 01111001 | |
10100001 10010011 01101001 => 01111000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
# Each line is 3 bytes of input and the observed 1-byte checksum | |
data="""\ | |
10100001 10010011 01100011 => 01110111 | |
10100001 10010011 01100100 => 01110001 | |
10100001 10010011 01100101 => 01110000 | |
10100001 10010011 01100110 => 01110010 | |
10100001 10010011 01100111 => 01110011 | |
10100001 10010011 01101000 => 01111001 |