#milkymist IRC log for Friday, 2011-02-18

lekernelhow clean/dirty is it to define special pointer values in C?18:06
lekerneli.e. #define FOO ((void *)1)18:06
lekernelafaik on all MMU-enabled systems, the first page is never mapped, which means we should have at least ~2k such possible values18:07
Fallenouwhat would be the use of such a pointer lekernel ?18:15
lekernelmarking LLHDL nodes as being consumed by a custom mapper (arithmetic, RAM, ...) with information about the generated netlist elements stored in the parent LLHDL node18:17
lekerneleach LLHDL node has a pointer, which could either point to the netlist information structure or take that special value18:17
lekernelor NULL if they aren't mapped yet18:18
Fallenouwhat would it mean for the node to point to this special value ?18:19
Fallenouinstead of pointing to the netlist18:20
Fallenouor NULL18:20
lekernelthis way of functioning enables extra logic to be stuffed into particular macros to optimize the mapping efficiency18:20
lekernelfor example, an adder using the carry chain only uses 2 inputs (out of 6) of the LUT in the slice18:21
Fallenouyes18:21
lekernelthe other inputs of the LUT could be used to implement logic with up to 4 variables that feeds the operands18:22
Fallenouok but this LUT output is already used, to carry to the next operand, right ?18:22
Fallenouso how can you use it to do other things ?18:22
Fallenou(i don't remember how many outputs there are in a LUT :xx)18:23
lekernelso, in LLHDL the arithmetic mapper would look at what logic is connected to the operands, and if it has less than 4 variables, stuff that into the same LUT that generates one bit of the addition/subtraction result18:23
lekerneland mark the LLHDL nodes implementing said logic as "consumed"18:23
Fallenouok I understand the optimization18:24
lekerneli.e. they do not instantiate anything in the netlist, but this is handled by the parent18:25
wpwraklekernel: how would you use these "special" pointers ? just check if it's special_A or special_B, etc. ? or would you treat them as a class, i.e., have a test if it's anything special ?19:19
wpwraklekernel: in the former case, i'd suggest to just allocate an otherwise unused memory object19:19
wpwraklekernel: the (void *) 1 hack would almost certainly work, but you never know when something comes along that breaks it19:20
lekernelif(p == NULL) foo(); else if(p == SPECIAL_X) bar(); else process_stuff_pointed_by_p(p);19:20
lekernelthe (void *)1 hack also has the advantage that it would segfault if it gets deferenced due to some bug19:22
lekerneldereferenced19:22
lekernelinstead of corrupting stuff and mysteriously crashing later on19:22
wpwraklooks like just allocating a different memory object would be the portable way to go. you can still #ifdef the (void *) 1 hack for catching dereferencing19:23
lekernelor can we use mmap()?19:23
lekerneland reserve a "no access" range for those special values19:23
wpwrakdon't create complex dependencies ;-)19:23
lekerneloh it's not complex19:24
lekernelwasn't it you who said that MMU and mmap() was like a multiplier those days? :)19:24
wpwrakyou'd be competing with malloc. yes, you can do that, but ...19:24
lekernelmalloc() handles mmap'd regions nicely19:24
wpwraksure. but it's this sort of things that get you in trouble when on "unusual" systems19:25
wpwrakthere doesn't seem to be much of a need to go to extremes here, so why bother ?19:26
lekernelwell, of course, this stifles the runnability of the LLHDL tools on MMU-less LM32 for self-reconfiguration ;)19:26
wpwraksee :)19:26
lekernelbut i'm not even sure this would be usable anyway... maybe slow, and we need libgmp19:27
lekernelseems I just have to use PROT_NONE (no access) and MAP_ANONYMOUS (no backing file descriptor).... and I get a nice range of guaranteed-immediate-segfault addresses19:29
lekernelin a POSIX-compliant way19:29
Fallenouahah the famous PROT_NONE used by go ? :p19:29
wpwraklekernel: posix doesn't guarantee segfaults :)19:31
lekernel"PROT_NONE  Pages may not be accessed." so what happens if you do?19:31
lekernelyou get sig11, no?19:31
lekernelat least on all systems I know of19:31
wpwraklekernel: "if the Memory Protection  option  is  supported, the implementation shall not permit a write to succeed where PROT_WRITE has not been set or shall not permit any access where PROT_NONE  alone had been set." so far, so good. but ...19:32
wpwraklekernel: "If the Memory Protection option is not supported, the result of any  access  that  conflicts  with  the specified  protection  is  undefined."19:32
lekernelwell, said protection is only really useful when debugging pointer bugs, right?19:33
wpwraklekernel: yes, unless you start getting other ideas, such as your code depending on a signal handler to be called ;-)19:33
lekernelit's a simple command line tools that has little to do with signals...19:34
wpwraklekernel: that would be the ultimate optimization - handle the special cases with the mmu ;-)19:34
lekerneland it would be pretty stupid to catch signal 11 anyway19:34
wpwrakbut yes, the mmap approach is more portable than (void *) 1, at least in the sense that if it won't work at all on a given platform, you'll find out quickly19:36
wpwrak(as in mmap not existing/returning an error)19:36
kristianpaulFallenou: Are you awake/around?23:25
Fallenouyes !23:26
kristianpaulI'm taking a look the the flicernoise code, and i noticed this23:27
kristianpaulsysettings.c:139:             "e_login = new Entry()",23:27
kristianpaulsysettings.c:141:             "e_password = new Entry(-blind yes)",23:27
Fallenoukristianpaul: have you tried forcing your ethernet card to work at 10 Mbps ?23:27
kristianpaulFallenou: hmm not23:27
Fallenouto see if it prevents the rx fifo from becoming full ?23:27
kristianpaulhmm23:28
Fallenouit would be worth a try :)23:28
kristianpaulgood point23:28
kristianpaulsure i will23:28
Fallenouok thanks!23:28
FallenouI tested ttcp23:28
Fallenouwithout any bug, as it seams i cannot reproduce the bug with qemu :/23:28
Fallenoui will have to try to fix it blindly23:28
kristianpaulas soon i got te way to add a ftp user to flicernoise by commad23:28
kristianpaulah you dont have a mm one..23:28
Fallenouroot does not work ?23:28
Fallenouno i don't :/23:28
kristianpaulroot got login but said 550 Acess denied as soon i try a ls23:29
Fallenouoh23:29
Fallenoustrange23:29
Fallenoudid you try ls /dev23:29
Fallenou?23:29
kristianpaulno no23:30
Fallenouusing the shell I can do such a ls23:30
kristianpauli mean ftp !23:30
Fallenouyes via the ftp23:30
Fallenoutu list the /dev23:30
kristianpaulroot password rtems?23:30
kristianpaulor no password?23:30
Fallenouno password23:31
Fallenouif it is like the shell23:31
kristianpaulsame thing...23:31
kristianpaullast time i tested after add a user using GUI but i'm going to do that again23:32
kristianpaulso i was digging how flickernoise added a ftp user23:32
Fallenouwow23:32
Fallenouusing flickernoise in qemu, i got weird mouse movements23:33
Fallenoui just cannot use the GUI23:33
Fallenouthe mouse is doing crazy stuff23:33
kristianpaul:\23:33
Fallenouit is moving randomly everywhere while i move it23:33
Fallenoumwalle do you have such a behaviour ?23:33
kristianpaulcan you TAB ?23:33
Fallenouno23:33
Fallenoudoes no do anything23:33
kristianpaul:-(23:33
Fallenouoh, now that i clicked on a button23:34
Fallenoui can tab23:34
kristianpaulphew23:34
Fallenouclick works, if I happen to be on a button :)23:34
Fallenoubut it is totally random where I move23:34
kristianpaulweird i remenber whe i was using qemu i dont have that behavior23:35
kristianpaullet me try23:35
kristianpaulFallenou: i dint get GUI to boot, actually i just got flooded with "milkymist_memcard: read more cmd bytes than available. Clipping."..23:43
Fallenouyes23:43
FallenouI have been told that you have to create a file23:43
Fallenouempty file should do23:43
Fallenoulike dd if=/dev/zero of=sdcard bs=1M count=3023:43
Fallenouand then append -sd sdcard to qemu command line23:44
Fallenouit made my flickernoise boot :)23:44
kristianpaulmy mouse cursor is okay here23:45
Fallenouoh !23:46
Fallenouwell let me restart my VM then :o23:46
kristianpaulVM is cheating !23:46
kristianpaul;-)23:46
kristianpaulpoor qemu23:46
kristianpaul;-)23:46
Fallenou=)23:48
Fallenouwell I still have the problem23:48
Fallenouit's a really clean ubuntu VM23:48
Fallenoujust installed to do RTEMS dev23:48
FallenouI am using the touchpad :o23:48
Fallenoumaybe it's the problem23:48
Fallenoubut I don't have any mouse23:49
Fallenouand it used to work well with a touchpad before23:49
kristianpaulmtk is really simple :-)23:49
kristianpaulIs that a Mac?23:49
Fallenouanyway I still have 2 "read more cmd bytes" ...23:49
Fallenouyes23:49
kristianpauldo you understand what is for the lines of code i pointed before?23:50
kristianpaulI still not get how it change ftp in rtems to make that user and pass to login23:50
kristianpaulah !, sysconfig_get_credentials(login, password);23:52
Fallenou:)23:54
Fallenouno i don't understand sorry23:54
FallenouI have almost no knowledge of how flickernoise works23:54
Fallenoui mean MTK23:54
kristianpaulno no you dont23:54
kristianpaulneed23:54
kristianpaulI think i found my answer23:55
Fallenouok great !23:55
Fallenouso root / nothing didn't work ?23:55
kristianpaulhttp://paste.debian.net/108129/23:55
kristianpaulFallenou: nope23:55
Fallenouoh, but the thing you just pasted indicate the use of the system login and pass , right ?23:55
Fallenouso it should be root / nothing :o23:56
kristianpaulno no, thats code is called when you set Remote Acess in System Settings (flickernoise gui)23:56
kristianpauldunno why root is not allowed23:57
Fallenouoh ok23:57
kristianpaulactually i did log in my a foo user and is same behavior..23:57
kristianpaulFallenou: http://paste.debian.net/108130/23:59
Action: Fallenou watches a battelstar galactica23:59
kristianpaulhehe23:59
Fallenouor my head is gnna explose23:59
kristianpaulok good23:59
Fallenouweek has been hard23:59
--- Sat Feb 19 201100:00

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