#qi-hardware IRC log for Monday, 2013-09-16

DocScrutinizer05http://neo900.org/ minor improvements on page design00:09
pcercueilooks... interesting00:10
pcercueiit's a GTA04, inside a N900 case?00:13
wpwrakwhee ! now it has a keyboard :)00:27
wpwrakthe feature list looks impressive :)00:29
wpwrakmaybe also mention display and battery ?00:30
wpwrak... since it's already more a feature list than a mere comparison chart :)00:30
pcercueiwhat would be the price of something like that?00:35
qi-bot[commit] Werner Almesberger: modules/tswa.fpd: add hole to through-hole pads (master) http://qi-hw.com/p/kicad-libs/a808cc100:44
qi-bot[commit] Werner Almesberger: modules/stdpass.fpd: add 1008 (for Samsung CIG22L4R7MNE inductor) (master) http://qi-hw.com/p/kicad-libs/2cf146c00:44
qi-bot[commit] Werner Almesberger: components/aat1217.lib: Skyworks AAT1217 step-up converter (master) http://qi-hw.com/p/kicad-libs/dc5ce7a00:44
qi-bot[commit] Werner Almesberger: modules/sot.fpd: add 236 (23-6) footprint (master) http://qi-hw.com/p/kicad-libs/784f0e600:44
wpwrakroh: ever tried resin casting ? e.g., polyester or acrylic ? it seems that this is almost as good as injection molding - with chemistry replacing the fancy machines07:28
qi-bot[commit] Werner Almesberger: components/er-oled-fpc30.lib: change pin 30 from NC to GND (master) http://qi-hw.com/p/kicad-libs/c5278c509:58
qi-bot[commit] Werner Almesberger: add C&K JS102011SAQN SPDT SMT switch (symbol and footprint) (master) http://qi-hw.com/p/kicad-libs/18ed84d09:58
qi-bot[commit] Werner Almesberger: components/kl25-48.lib: add pin 49 for the center pad (master) http://qi-hw.com/p/kicad-libs/b32bd3209:58
whitequarkhm12:28
larschm, anybody has a /dev/video device on their system and wants to test something for me?12:31
whitequarklarsc: I've a webcam12:31
larscwhitequark: try http://pastebin.com/xKxgLKKu (may crash your machine though)12:37
whitequarkret: -1 1412:40
whitequarknothing else12:40
larscyea, that's kind of what I expected12:41
rohwpwrak: nope. forms are still the major work12:42
rohand i dont like chemicals12:42
larscwhitequark: but with a better magic number I think you could get it to expose any physical mempry12:43
whitequarklarsc: hm strange12:44
larscif count is large enough you bypass this check http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/media/v4l2-core/videobuf2-core.c#n237012:45
larscand then down here you can move the offset to any position you want http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/media/v4l2-core/videobuf2-core.c#n239312:46
lekernelwhen will people stop using C for everything? :)12:47
lekerneland even before that, userspace drivers would be a GREAT idea.12:48
lekernelLinux isn't even consistent - e.g. for USB, you can either write a kernel module or use libusb. same with FUSE. two APIs where there should be only one.12:49
whitequarklekernel: uhhh, FUSE is also incredibly slow12:49
whitequarkalso I haven't really seen well-written FUSE drivers, except perhaps ntfs-3g, though that may have another reason12:49
whitequarke.g. MTP is unusable.12:50
lekernelyeah well, the fundamental idea is that parsing/generating filesystem structures needs not be done in kernel space.12:50
whitequarkI call bullshit... there's been n+1 attempt at microkernels and they never worked12:50
whitequarkwhat you actually need is a safe language which doesn't allow errors in parsing/generating filesystem structures to lead to memory corruption12:51
lekerneland why didn't those microkernels work, exactly?12:51
whitequarktoo slow12:52
whitequark(of course, most of them died because of other, social reasons. but the technical reason is "too slow".)12:52
lekernelI'd say minix, for example, pretty much works.12:52
Action: whitequark sighs12:53
whitequarklet me phrase it another way.12:53
whitequarkif you have a kernel written in a memory-safe language, is there any reason to keep kernel components in separate address spaces?12:53
lekernelthat sounds harder to do than a microkernel12:54
whitequarkyou *can* use messaging if it's more convenient; you *can* restart tasks if they fail; you just don't have to, if that's too slow12:54
whitequarkeh12:54
lekerneland what about untrusted proprietary kernel modules?12:54
whitequarklekernel: those can very well use FUSE and be slow as hell, imo.12:54
whitequarkthey're heavily penalized (not in perf) right now anyway12:55
whitequarklekernel: (harder to do) well, let's now compare my scheme to yours--which, as I understand it, is components written in unsafe language, but kept in separate AS's12:55
whitequarkso what do I do if I pwn a filesystem server? I rewrite kernel image.12:55
whitequarkDONE>12:55
larscbut /dev/video devices can usually be accessed by a normal user, can't it?12:57
whitequarklarsc: true12:57
whitequarkwhat you found looks like a bug, no?12:58
larsca zero day12:58
larsc;)12:58
whitequarkwhat does it do on your machine?12:58
whitequarkhow did you find it?12:58
larschadn't had the chance to test yet on my machine12:59
larscI'm writing code similar to the v4l buffer code and noticed that they didn't check this case12:59
larscthat check should basically be if (count > buf->size || buf->pos + count > buf->size)13:00
larscor count > buf->size - buf->pos13:01
wpwrakhmm, fedex seem to have slowed down their southern cone operations. shipment left only last night. so that's the full 2 day weekend penalty instead of just one.13:21
ysionneausending messages between "system" services is much slower than function call I imagine13:28
ysionneauand then you have context switch as well13:28
ysionneaubut the idea of just restarting a daemon instead of kernel panicing is indeed nice :)13:28
wpwrakyes, especially because we all know that the best-written and best-tested code in drivers is usually the exit/cleanup code ;-)13:35
rohwpwrak: well.. usually thats even correct13:36
rohor have you seen sane error handling code in daemons?13:36
lekernelysionneau, including with hardware support for fast context switch?13:36
ysionneaufor the lucky enough arch to have fast context switch maybe the penalty is small13:38
wpwrakroh: i mean comparing "regular use" driver code vs. "cleanup" driver code :)13:38
lekernelI think it's possible to have an instruction as fast as a jump that can context-switch between a dozen cached processes13:39
wpwrakroh: but yes, whenever something gets special error-handling procedures, the chance of getting them wrong is pretty high13:39
ysionneauwith some kind of process ID and register shadowing?13:39
lekernelyes13:39
ysionneauimo arm does that (or some other arch I don't remember) for 2 processus13:39
ysionneaumaybe cortex-R something13:40
lekernelmake that 16 and I'm sure microkernels will have no perf penalty whatsoever13:40
rohwpwrak: atleast in drivers i KNOW people thought about cleanup. in daemons people dont give a shit and just segfault all the time13:40
ysionneauhttp://lwn.net/images/conf/rtlws11/papers/proc/p01.pdf 13:41
rohlekernel: 16? gnihihi... on a recent desktop you'd need a few hundred for hw drivers alone13:41
ysionneauthats for not trashing TLB13:41
lekernelnot active within microseconds of each other13:42
rohyou got 16 real cpus on a computer.. so i guess the numbers need to be higher13:42
wpwrakroh: yeah, daemons are built with other assumptions. and/or less regard for considering the assumptions :)13:42
lekernelthat's why I said *cached* processes13:42
wpwrak16 seems pretty deep already. if you go that deep for frequently used things, you may have a serious complexity problem :)13:43
rohwpwrak: i guess that was implicated when we started building computers with dozends of cores, didnt weß13:44
rohanyhow.. bbl.. gotta use the non-rain-period13:44
lekernelmessage passing between CPU cores is slow13:44
lekernelcontext-switching the current core with that special instruction is fast13:45
larscif you have managed code you don't need memory protection anyway and everything runs in the same context ;)13:49
ysionneau=)13:49
wpwrak"if you have nothing to hide, there's no reason to be afraid" ;-)14:26
wpwrak"if you don't have any enemies, there's no need to worry about exploits"14:27
wpwrakdamn. this is so easy. why do i torture myself with code and electronics when i could have become a politician ?14:27
Freemorwpwrak: I'm guessing because you have a soul 14:31
wpwraksomeone once said: "in politics, honesty is everything. once you can fake it convincingly, you've made it."14:35
whitequarkha14:44
rohre14:46
rohlarsc: i think memory protection without using memory mapping is a nice idea14:47
rohbasically.. run everything as position independant code. same memoryspace, but with protection. nowadays you even got io-mmus in your hardware, so it should be faster than what we do now14:48
whitequarkthe things you do to avoid using safe languages :p14:50
rohwhitequark: safe languages do not avoid people wanting to abuse interfaces or brainfarts like off-by-ones and similar think-o-s14:50
larscit's not about the language, it's about malicious applications14:51
rohso.. doing stuff right isnt anything you get around anyhow.14:51
larscwith managed applications you basically do the memory protection in sw14:51
whitequarkroh: yeah, off-by-ones and logic errors generally are the same, but they cannot lead to code execution in arbitrary places14:52
rohlarsc: thats pure theory. in reality thats all bogus. nobody really uses such stuff outside the lab14:52
rohwhitequark: oh yes, they can.14:52
whitequarkroh: how so?14:52
whitequarknote the "arbitrary", if you explicitly load a chunk of code and jump to it, sure. but it is generally easier to make sure all code paths to something like that are good14:53
whitequarkthan to check every single array access everywhere14:53
rohwhitequark: also.. you got shitloads of badly programmed and even less understood hardware, capable of dma and similar memory access patterns... how do people get to the impression that somebody hostile with enough time would NOT be able to place arbitrary binaries at the right place in memory?14:54
whitequarkroh: perfect security is impossible (with real-world hw), but you can raise the barrier14:54
rohso.. YES you need iommu hardware and correctly programmed drivers.14:54
rohand proper hardware. and STILL you need to audit your code. and against none of those errors a programming language can help you.14:55
whitequarkthat still doesn't protect you from bugs in cpus/iommu hw14:55
whitequarkeg recent xen issue14:55
rohso.. forget that bullshit that buffer overflows are your only problem. its only one of many. and a language doesnt save you from yourself.14:55
whitequarkroh: again: I'm not saying it *solves* security, it merely reduces the amount of stuff you need to care about14:55
rohwhitequark: no. it makes coders more stupid.14:55
whitequarkroh: bullshit. writing same trivial checks over and over again doesn't make you clever.14:56
rohcheck out java. it didnt make more people able to code. it made more able to code very badly. thats not helping.14:56
rohwhitequark: nobody does that. every sane person uses macros for that.14:57
Action: whitequark silently points at the bug larsc found14:57
rohwhitequark: dont always look at 'i am a bad beginner'-code like openssl ;)14:57
whitequarkso, v4l2 code is 'i am a bad beginner'. ok14:57
whitequarkI don't care how much idiots are going to think they can code now. it's not a technical problem, it cannot be solved (or "unsolved") by technical means14:58
whitequarkI care about people who know what they do, spending less time doing pointless shit14:58
rohexactly. so its not helping blaming bad tech, when its bad design by people. thats all i am saying.14:59
whitequarkwell, languages which make you write hazardous boilerplate instead of actually important code do have bad design after all15:00
whitequark(and java is just as guilty of that)15:01
whitequarkI bet someone here understands USB better than me18:04
whitequarkwhat's the rationale for having tokens DATA0,1,2 instead of just DATA ?18:04
whitequarktoo much spare identifiers? :D18:04
whitequarkhm, http://www.microchip.com/forums/m663890.aspx18:07
DocScrutinizer05wpwrak: I don't know why you say this table is more of a feature list than a comparison18:14
wpwrakDocScrutinizer05: i would read it as a feature list, because a) it mentions most of the main features b) i'd be more interested in learning about the features of the new product than those of some obsolete devices. of course, if you're coming from the N900, that may be different :)18:23
DocScrutinizer05that table lists the differences, just that18:24
wpwrakDocScrutinizer05: in terms of marketing, i think a good point to emphasize would be the fusion of three successful projects: 1) the gta04 OPEN hardware, 2) the nice Nokia case, and 3) the friendly and proven GUI.18:24
DocScrutinizer05>>Neo900 will preserve all the features of N900. With upgrades!<<18:24
DocScrutinizer05yep, exactly18:25
wpwrakyes, but there are so many differences that you may just add the remaining features as well, even if they're the same :)18:25
DocScrutinizer05http://mynokiablog.com/2009/08/27/nokia-n900-technical-specifications/18:26
DocScrutinizer05a tad long18:26
wpwrakwell, key features. at least the screen :)18:27
rohDocScrutinizer05: is there a list of parts for the mechanics and some explosion-drawing?18:28
rohmaybe even pricetags?18:28
DocScrutinizer05well, there is schematics and service manual L1_2 and L3_418:29
DocScrutinizer05for n90018:29
larschm, is their some magic build-in gcc macro that tells me whether X is a pointer or an array?20:40
whitequarklarsc: __builtin_offsetof? __builtin_object_size?20:43
larschm, I would I use them?20:53
whitequarkI imagine a pointer will usually be pointer-sized and array will be larger.21:00
whitequarkactually, nevermind21:00
larscusually21:00
larscbut I found something that works21:01
larsc#define IS_ARRAY(x) (!__builtin_types_compatible_p(typeof(&(x[0])), typeof(x)))21:01
whitequarkha, clever usage of decay21:01
whitequarkbut why do you want that?21:01
larscI want to check that the size of an buffer is large enough if we know the size at compile time21:02
larschm, maybe thats __builtin_object_size?21:02
larscyea21:03
larscthought __builtin_object_size would just return 4 for an pointer21:03
larscbut that's not the case21:04
DocScrutinizer05roh: what exactly are you interested in?23:32
DocScrutinizer05pricetags for what in particular?23:33
DocScrutinizer05I don't completely get it what you're asking for23:33
DocScrutinizer05the "Nokia" parts needed to build a complete device around a GTA04-NeoN board? We googled for them, part by part, from all over Europe and Asia. Some parts are hard to source, e.g. the domesheet. Others are abundance, like the case/shell plastic23:36
DocScrutinizer05but basically yes, we found a source for every single one of those bits23:36
DocScrutinizer05some - like the FPC with camera, proximity detector, ALS, and 3 color indicator LED and earpiece - are amazing cheap: ~7EUR23:37
DocScrutinizer05other parts, like the main camera module, cost more than gold: ~50EUR23:38
rohDocScrutinizer05: i see.. is there a wiki with that somewhere?23:40
rohbut good information23:41
DocScrutinizer05nope, no wiki with all that knowledge/info yet23:46
roh;)23:48
DocScrutinizer05it's also kinda volatile info, given the dynamics of fleabay etc23:55
DocScrutinizer05and I'm afraid the situation might look different when we do same check again in 4 or 6 months from now23:56
DocScrutinizer05availability of spareparts fro N900 at large depletes rapidly23:57
DocScrutinizer05OTOH used, broken N900 seem to spread all over the fleabayshere23:57
DocScrutinizer05sphere even23:58
--- Tue Sep 17 201300:00

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