The voting network..

March 12th, 2006

The problem we have in building a honest and reliable voting network is that we’ve got a couple of opposing goals.

First of all, we’d really like to be able to test that every single vote arrived in it’s appropriate bucket, and no single user voted more than once. These things would seem, on the surface, to require some form of good authentication and user-tagging.

But on the other hand, we really want users to feel free to vote their concience, without worrying that other people might find out what they’ve voted. This would seem to require a completely anonymous system.

Then there’s the matter of tallying the votes. Ideally, we would like each vote to be sent several places for tallying, rather than tallied at one place, and the results of the tallies compared.

I really think that, especially given that this is new technology that will by its very nature be buggy, and in some sense at least the fate of the world rests on the results of this system (one could argue that that’s true of any system because everything is so interconnected, but I think in this case it’s more true than in most) we need the ability to verify our votes after they have been posted. This will require us to have some way to authenticate ourselves to the network – I’m thinking something like a ATM card, issued to every voter, with their name and SSN encoded on it. It could probably even just be a magstripe on a conventional ID like a drivers license.

Anyway, some completely anonymous (as far as any outside snoop could see) token should be either assigned to or generated out of the name and SSN, and attached to the ‘envalope’ of the ballot. That way the user could go home and with their web browser, hit up www.whatdidIvote.gov and verify that their vote was in fact sitting there, and had been counted.

Also, because this is completely new technology, I think it’s important that it be open-source. The open-source community would probably rally around a project to build a voting machine network that was honest using nothing but PCs, and because it was open-source it would be possible to verify that it had not been coded to favor any particular canidate in any way.

[At the moment, the situation we have is that the vice president of the u.s. has stock in the government-favored electronic voting machine company Diebold.. if anyone knows of something that smells more of conflict-of-interest than that, please don’t tell me about it because I’m really afraid to know]

Bleh. Must go shower. More later.

Positive steps..

March 8th, 2006

I’m trying to document positive things that I’m doing, mostly just to give me some hope that the future is going to look brighter than the past

1) Psychologist
2) Psychiatrist
3) Cleaning house
4) Installed and using calandering system on Gateway
5) Couples counselling
6) Oxygen
7) Filing system and organizers for office (though still much to do in that realm)

Right now I’m feeling really sad and broken and things with Kayti are not feeling like they’re going well..

Happy happy. etc.

March 6th, 2006

brassrat.net is fixed. It wasn’t nearly as painful as I thought it would be – I faxed them my license last night, today they emailed me with my username and password, and me and enyc made a few changes here and there and we’re back on the net. Happy happy.

S.

Loving something as it is..

March 5th, 2006

We tear each other up, wanting each other to be something different or to do something different or to become someone different or to be new and improved in this or that or the other way.

Why can’t we love each other just the way we are?

Grrr…

March 4th, 2006

I forsee much running around in circles tomorrow.

Hammernode, who have been doing primary DNS for brassrat.net for just about forever, have folded up shop. I don’t remember the username and password that the account is registered under, and I have to change the authoritive nameservers because right now, they point to localhost. (Ha. ha. ha. ha.). Oh, and the email address that I would use to get new information from them – currently registered @ brassrat.net. WHo’s bright idea was that? Oh, right, mine..

I have a dns server set up on sheer.us, so creating the zone isn’t that difficult, but I have to fax a photo ID before they’ll send me my username and password.

Amazingly, while normally this would be leaving me feeling crushed and depressed and stressed out, right now I find that I’m just not that worried about it. So the domain will be down for a day. It won’t be the end of the world.

I think I’m finally recovering from dot com madness.

Now, to figure out how to like myself.

(occasionally I wonder if I should transfer brassrat.net to Phoebe, since she’s the one who’s family was the origins of the name. THe problem is that I’m not sure she’s got a authorative nameserver to park it at, a webserver to host it on, or a mail server to deal with traffic on it. Or all that much interest in dealing with any of these things. But, at this point I have to concede that if she’s ready to deal with the technical challenges involved with the name and she wants it, it’s really more hers than mine)

I’ll have to come up with a new name for my consulting business at that point, though.

Interesting dream..

January 29th, 2006

I had a interesting dream last night – I was flying with my boss in a 8-seater overwing of some sort – we were flying over a bridge, although not a suspension bridge, and waves were crashing over the road surface of it – we were flying barely 500 feet up, and I kept feeling as if a wave was going to grab us at any time. Then one did, crashed over us and we were being pulled to the side and into a spin, and then my boss was trying to pull us out of the spin and was pulling like a 4G turn, and I kept yelling about how a overwing wasn’t going to handle a 4G turn and then the tail broke off (not the whole tail. I think the rudder was still there – but the li’l bits that stick out with the elevators were gone. I don’t think this is a very realistic failure mode for a overwing pulling too many Gs but it was a dream, what do you want?)

The next sequence was a remarkably realistic crash landing near a airport in which the plane ended underwater but still intact, my boss finding the black box (yah, I know, a 8 seater with a black box..) and the emergancy radio and then a skip to me in a airport trying to find a commercial flight somewhere and all was bedlam and no flights were going anywhere and I ended up on a bus to somewhere in europe.

And things kept getting weirder from there although not, thankfully, scarier.

The thing is, I am wondering if this dream means I have a subconcious fear of flying – I don’t think I’m afraid of flying – I’ve been thinking of buying a little two-seater ultralight if I ever get out of debt.. (fully enclosed and with instrumentation, but a top speed of about 120 and a operational ceiling of < 8k feet - apparently the license test for them isn't much harder than a driver's license test and they're easier to land than a hang glider). Now I'm wondering if I secretly fear flying - or else fear it in small aircraft - and just don't know about it. I've been up several times with my boss in a little Cessna trainer, and it seemed quite fun at the time. Ah, the inner workings of the subconcious mind, always interesting to get a glimpse at.

Bootloader footnote

January 23rd, 2006

The bootloader I published does not include the header files, and includes code for setting the internal osc against a 32khz crystal. If you don’t need the latter, be sure to strip it out. If you do need the former, email me at sheer dash panic at sheer dot us

January 23rd, 2006

1) I’ve updated my resume for those of you who care about such things. It’s at http://www.sheer.us/resume/SheerResume-ascii-wa.txt

2) Below please find a bootloader for a Atmel AVR AtMega8 which accepts a binhex file uploaded via windows terminal (or however else you would like). I’m releasing this code to the public domain at this point. Feel free to do whatever you like with it, or not, as appropriate. It could probably easily be modified for any AVR CPU

start_bld:
cli
ldi ZL, LOW(RAMEND)
ldi ZH, HIGH(RAMEND)
out SPL, ZL
out SPH, ZH ; set up the stack

rcall init_bld ; set up some hardware stuff
rcall idle_timer2_bld ; start timer2 ticking
rcall set_system_clock_bld ; setup the system clock for 7.2738Mhz

; check and see if there is a serial console present

sbis RS232_INVALID_IN_PORT, RS232_INVALID
rjmp bld_do_boot ; if no console, boot

ldi uart_char, XON ; send welcome banner
rcall uart_put_char_bld
ldi uart_char, ‘B’
rcall uart_put_char_bld
ldi uart_char, ‘l’
rcall uart_put_char_bld
ldi uart_char, ‘d’
rcall uart_put_char_bld
ldi uart_char, ‘>’
rcall uart_put_char_bld

rcall uart_get_char_bld_to ; get a char, or timeout and fall through
brts bld_do_boot
cpi uart_char, ‘B’ ; if ‘B’, then boot right now
breq bld_do_boot
cpi uart_char, ‘U’ ; if ‘U’, then go into upload mode
breq bld_do_upload ; todo: authentication

bld_do_boot:
jmp ivec_reset

; ‘stubbies’ used to make short relative jumps work okay

bld_do_upload_crc_special1:
rjmp bld_do_upload_crc_special

bld_do_flush1:
rcall bld_do_flush
rjmp bld_do_upload

bld_do_upload_err1:
rjmp bld_do_upload_err

; ******* Upload routine. Decodes lines of Intel Hex, writes them to the flash
; displays a error for bad lines

bld_do_booty:
rcall bld_do_flush
rjmp bld_do_boot

bld_do_upload:
; for now, fetch a line, check its checksum, report back good or bad, wash, rinse, repeat
rcall crlf_bld
ldi ZL, LOW(STRING_SCRATCH)
ldi ZH, HIGH(STRING_SCRATCH)

rcall uart_get_string_bld
ldi uart_char, XOFF ; send XOFF in case this
rcall uart_put_char_t_bld ; takes a while
rcall crlf_bld ; debugging
ldi ZL, LOW(STRING_SCRATCH)
ldi ZH, HIGH(STRING_SCRATCH)

clr XL
clr sample_cnt

ld uart_char, Z
cpi uart_char, ‘:’
breq bld_do_upload_ok
cpi uart_char, ‘F’
breq bld_do_flush1
cpi uart_char, ‘B’
breq bld_do_booty
cpi uart_char, CR
breq bld_do_upload
cpi uart_char, LF
breq bld_do_upload
rjmp bld_do_upload_err1
bld_do_upload_ok:
rcall ascii_to_bin_hex_bld ; convert first 4 bytes of input
; (should be length and high addr)

sts LINE_LEN, TempH ; save length in RAM
mov Temp2, TempH ; store byte count in temp register

sub XL, TempH
sub XL, Temp ; compute checksum

sts LINE_ADDR_H, Temp ; store high byte of address

rcall ascii_to_bin_hex_bld ; convert second 4 bytes of input

sts LINE_ADDR_L, TempH ; store low byte of address
sts LINE_TYPE, Temp ; store line type

sub XL, TempH ; compute checksum
sub XL, Temp

; fetch data, store in line

; hopefully data is even, but no guarentee

ldi YL, LOW(LINE)
ldi YH, HIGH(LINE)

cpi Temp2, 0
breq bld_do_upload ; if zero length record, skip

dec Temp2 ; LENGTH is +1, from dec standpoint

bld_do_upload_loop:
rcall ascii_to_bin_hex_bld ; translate ascii to binary

st Y+, TempH ; store bytes (high)
st Y+, Temp ; store bytes
sub XL, TempH ; compute checksum
sub XL, Temp

dec Temp2 ; LEN was given in bytes
breq bld_do_upload_crc_special1 ; special case: odd number of bytes
dec Temp2 ; but we do words so need 2 decs
brne bld_do_upload_loop ; go around again?

rcall ascii_to_bin_hex_bld ; grab CRC
sts LINE_CHECK, Temp ; store CRC
bld_do_crc_check:

lds TempH, LINE_TYPE

; ldi uart_char, ‘0’
; add uart_char, TempH
; rcall uart_put_char_bld

cpi TempH, LINETYPE_HDR
breq bld_do_upload

cp Temp, XL ; compare CRC to stored
brne bld_do_upload_err1 ; if it doesnt’ match, err

; matches, so program part

ldi YL, LOW(LINE) ; use Y ptr to access
ldi YH, HIGH(LINE) ; stored data for this line
lds Temp2, LINE_LEN ; Temp3 contains countdown
lds ZL, LINE_ADDR_L ; Z ptr is address in flash
lds ZH, LINE_ADDR_H
ldi XL, LOW(BOOTLOAD_START*2) ; X ptr is max flash addr to write
ldi XH, HIGH(BOOTLOAD_START*2) ; keeps us from writing bootloader
; which would put is in NWRW state
; and be bad

bld_do_program_loop:
cp XL, ZL ; check to see if we’re
cpc XH, ZH ; outside of the bootloader
brlo bld_do_program_loop_end ; do not program bootloader
; even if it is in file
mov TempH, ZH ; grab the page
mov Temp, ZL ;
andi Temp, 0xC0 ; skip off the byte address
; leaving only the page address

lds Temp3, LAST_PAGE_L ; compare against
cp Temp, Temp3 ; the last page that
lds Temp3, LAST_PAGE_H ; we used and
cpc TempH, Temp3 ; if it’s different
breq bld_do_program_skip_write ; then we need to write that page

; if we get here, then we must
push ZL ; preserve Z
push ZH

lds ZL, LAST_PAGE_L ; restore previous Z (page we
lds ZH, LAST_PAGE_H ; want to write)

rcall wait_spm_bld ; wait for SPM to clear

ldi Temp, (1<=? Then non-digit char, end

ascii_to_bin_hex_cont_bld:

adiw ZH:ZL, 1
movw mp16uH:mp16uL, YH:YL

ldi mc16uL, 16 ; load 16
clr mc16uh ; into multiplier

rcall mpy16u_bld ; and multiply

add m16u0, XH ; Add current value to stack
clr XH
adc m16u1, XH ; carry as needed

movw YH:YL, m16u1:m16u0

dec XL ; This keeps us from
brne ascii_to_bin_hex_loop_bld

ascii_to_bin_hex_end_bld:
movw TempH:Temp, YH:YL
pop YH
pop YL
pop Temp2
pop XL
pop XH
ret

uart_put_string_bld:
; put a null-terminated string to the uart
; Z should be pointing to the beginning of the string in RAM
clr uart_char
st Z, uart_char
ldi ZL, LOW(STRING_SCRATCH)
ldi ZH, HIGH(STRING_SCRATCH)

uart_put_string_loop_bld:
ld uart_char, Z+
cpi uart_char, 0
breq uart_put_string_done_bld
rcall uart_put_char_bld
rjmp uart_put_string_loop_bld

uart_put_string_done_bld:
ret

crlf_bld:
ldi uart_char, CR
rcall uart_put_char_bld
ldi uart_char, LF
rcall uart_put_char_bld
ret

uart_put_char_t_bld:
sbis RS232_INVALID_IN_PORT, RS232_INVALID
rjmp uart_put_char_t_done_bld

push Temp
in Temp, UCSRA
sbr Temp, (1<

Just in case OMCN or JC reads this..

January 21st, 2006

Could one of you please explain why my ‘saying’ was ‘I am not god’?

Also, does anyone remember what OMCN’s was?

S.

For those of you keeping track..

January 21st, 2006

I’m currently in South Orange County, CA..