#qi-hardware IRC log for Thursday, 2014-09-18

zrafaOMG, that thing is set as GPIO for the keyboard00:12
zrafa!00:12
zrafaI want to kill myself00:13
sungdo any of you know what an ethernet network transformer is for?00:36
whitequarksung: sure00:36
sungi'm reading through schematics and i was wondering why ethernet pins aren't going str8 to a jack00:36
sungbut rather hittnig up a network transformer, and then a jack00:36
whitequarkethernet uses differential signalling; the transformer removes DC offsets and allows pulses to pass through00:37
whitequarkDC offset*00:37
whitequarksince you have a twisted pair, any voltage that's induced in the pair due to external interference is induced with roughly same magnitude in both wires00:38
sungohhhh.00:38
sungokay, so just because an IC has a PHY, doesnt necessarily mean it has a built-in network transfoemrmer00:39
whitequarkthere's also Power over Ethernet, which puts 48V between some two pairs00:39
whitequarkwith a transformer, you can still use them for data00:39
whitequarkyeah, putting a transformer into an IC is a pain ;D00:39
sungbro, thank you.00:40
sungand it looks like i can find ethernet jacks called magjack that has it builton00:46
whitequarkyes, plenty00:46
whitequark"magjack" though? not sure. I always seen some noname chinese connectors, never with a fancy name like that00:46
sunghttps://www.sparkfun.com/products/8534 is what i'm looking at00:51
whitequarksparkfun is super overpriced in general00:51
whitequark$1.95 seems ok though00:51
sungmy end goal is to get an rt5350f ic and basically make my own vocore01:00
sungand i don't care if it costs me 10 times what the vocore costs because i'm trying to learn stuff while i do it01:00
sungwhat i've learned so far is that It's Hard(tm)01:00
kyakhttp://cm.bell-labs.com/who/ken/trust.html16:15
kyakscary..16:15
whitequarknot really16:15
whitequarkif you have two compilers that were not designed to be used as a pair, you can detect it in any case very easily16:16
whitequarki.e. in worst case you just need to write a very bad and slow compiler that can compile your existing compiler yourself.16:16
kyakyeah, you have to write your own trustworthy compiler16:19
kyakeasy, right? :)16:20
whitequarkhuh? no16:20
whitequarknot at all16:20
whitequarkI need to write *any* compiler16:20
whitequarkthen I compile each of them with one another twice16:20
whitequarkthe thing is, in general it is not possible to insert such backdoor (this could be even logically proven, but I'll just say it's obvious)16:21
whitequarkso you have to rely on matching specific code in codebases you know.16:21
kyakyou have to write a compiler16:21
whitequarkso?16:21
whitequarkwriting a compiler is straightforward16:21
whitequarkespecially when you don't need to be 1) fast 2) complete 3) display sensible errors for incorrect code16:22
whitequarkwithout these requirements, it's not only straightforward, it's just trivial16:22
kyakok, you've written a compiler. Now, every time you compile it, you will get a bugged binary16:24
kyakand every time you use that bugged binary , you get another bugged binary16:24
whitequarkhttps://www.schneier.com/blog/archives/2006/01/countering_trus.html16:25
whitequarkmost important fragment:16:25
whitequark>This countermeasure will only fail if both A and T are infected in exactly the same way. The second compiler can be malicious; it just has to be malicious in some different way: i.e., it can't have the same triggers and payloads of the first.16:25
whitequarkin essence, the effort required to detect this hack is not even within an order of magnitude of effort that is required to produce it. it's way, way easier16:26
whitequarkand this process in fact happens in the wild all the time, e.g. when clang and gcc bootstrap each other16:26
virickyak: the fun is that Ken wrote the C compilers in the go toolchain :)16:27
kyakwhitequark: ok, i'm reading now16:27
viricwould you trust compilers from Ken?16:27
whitequarkno; they created C.16:28
whitequarkeconomically, likely the worst thing to ever happen to computing.16:28
viric:)16:29
kyakwhitequark: ok, i get it16:34
kyakwhitequark: so, when clang and gcc "DDC" each other, is V and W bit-to-bit equivavelnt? :)16:36
whitequarkkyak: compiler bootstrapping does, in fact, check bit-for-bit equivalence16:36
whitequarkas part of natural testing process16:36
whitequarkbut it's not really about that16:37
whitequarkmy point is that, for example, LLVM's history is public and cryptographically signed, and its internal structures change a LOT16:38
whitequarkditto for GCC. it's simply not possible to write a payload that would work on future versions of LLVM; you can't predict the future16:38
whitequarkso even if *at some point in past* this happened, it's not working anymore16:38
kristianpaulzrafa: yeah..16:54
kristianpaulrx pin keyboard :p16:54
kristianpaulyou already need more help? :)16:54
kyakwhitequark: i'm thinking if DDC would work for cross-compilers.. For example, gcc-arm - is there any compiler other than gcc that can compile gcc-arm?17:25
whitequarkclang, of course18:55
ysionneauclang can compile gcc ? :)18:56
ysionneaucool!18:56
whitequarkwhat? of course clang can compile gcc18:57
whitequarkwhy is this even a question/18:57
larscmaybe gcc requires some strange gcc extetensions ;)19:00
ysionneauI would expect GCC to contain crappy code that only GCC could ever compile :)19:01
ysionneauthat would not surprise me at all19:01
whitequarklarsc: well, it sorta does19:05
whitequarkit won't compile on a strict C99 compiler afaik19:05
whitequarkmaybe with some hacks19:05
mthI thought that GCC recently switched to C++19:07
viricthey started to welcome c++ code19:07
viricclang is more or less designed to compile what compiled in gcc, no? :)19:08
ysionneauthat's the goal yes19:08
viricso no wonder that it can build gcc19:08
ysionneaubut there is always some code somewhere that depends on some gcc specific behaviour19:09
whitequarkviric: indeed19:09
ysionneauand that will break on clang19:09
whitequarkalthough it rejects the more egregious hacks19:09
ysionneauthis is becoming less and less true though19:09
larscclang for example does not support variable sized arrays on the stack19:10
larscwhich is only support by gcc by accident19:10
larscsupported19:10
larscbecause they needed it for ada or something19:11
viricalloca ftw19:12
viric:)19:12
whitequarkclang has alloca, of course19:13
viricvariable sized arrays should be doable and easy.19:15
whitequarkif it was the case, they would be supported19:16
whitequarktake a look at clang's ML for details.19:16
viricthat was a quick though19:16
virict19:16
viricI'll read about it another day. Good that there is discusison though19:17
whitequarkI have no idea honestly, but I know that clang devs don't drop a feature solely because of ideological concerns or something19:17
whitequarkif it's not supported, it has a good reason behind it.19:18
viricgood reasons don't mean easy agreement :)19:46
viricbut can be. I don't use clang at all19:46
whitequarkgenerally it is maintainability concerns19:46
whitequarkgcc exposes a lot of accidental implementation details19:47
viricI never tried to write a compiler, so I might be not any good to judge :)19:48
larscwell they are not part of the standard19:49
whitequarklarsc: clang implements plenty of extensions19:50
whitequarkif you want standard, use -pedantic :D19:50
larschttp://clang.llvm.org/docs/UsersManual.html#intentionally-unsupported-gcc-extensions19:51
whitequarkviric: oh, right, VLAs are only disabled *in C++*19:52
whitequarkin C they do work19:52
whitequarkwith clang that is19:52
whitequarkVLAs on stack, I mean.19:52
pcercueiclang not having --print-sysroot breaks my Makefiles :(19:52
whitequarkVLAs in structures are a completely different story19:52
whitequarkthe former is part of C99, the latter is uh19:53
larscyea, I think that's what sneaked in through the ADA support19:55
whitequarkah19:55
larscIt was never meant to be in the C backend for gcc19:55
zrafakristianpaul: he, I am okey so far :)22:57
--- Fri Sep 19 201400:00

Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!