| lekernel | how clean/dirty is it to define special pointer values in C? | 18:06 |
|---|---|---|
| lekernel | i.e. #define FOO ((void *)1) | 18:06 |
| lekernel | afaik on all MMU-enabled systems, the first page is never mapped, which means we should have at least ~2k such possible values | 18:07 |
| Fallenou | what would be the use of such a pointer lekernel ? | 18:15 |
| lekernel | marking LLHDL nodes as being consumed by a custom mapper (arithmetic, RAM, ...) with information about the generated netlist elements stored in the parent LLHDL node | 18:17 |
| lekernel | each LLHDL node has a pointer, which could either point to the netlist information structure or take that special value | 18:17 |
| lekernel | or NULL if they aren't mapped yet | 18:18 |
| Fallenou | what would it mean for the node to point to this special value ? | 18:19 |
| Fallenou | instead of pointing to the netlist | 18:20 |
| Fallenou | or NULL | 18:20 |
| lekernel | this way of functioning enables extra logic to be stuffed into particular macros to optimize the mapping efficiency | 18:20 |
| lekernel | for example, an adder using the carry chain only uses 2 inputs (out of 6) of the LUT in the slice | 18:21 |
| Fallenou | yes | 18:21 |
| lekernel | the other inputs of the LUT could be used to implement logic with up to 4 variables that feeds the operands | 18:22 |
| Fallenou | ok but this LUT output is already used, to carry to the next operand, right ? | 18:22 |
| Fallenou | so 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 |
| lekernel | so, 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 result | 18:23 |
| lekernel | and mark the LLHDL nodes implementing said logic as "consumed" | 18:23 |
| Fallenou | ok I understand the optimization | 18:24 |
| lekernel | i.e. they do not instantiate anything in the netlist, but this is handled by the parent | 18:25 |
| wpwrak | lekernel: 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 |
| wpwrak | lekernel: in the former case, i'd suggest to just allocate an otherwise unused memory object | 19:19 |
| wpwrak | lekernel: the (void *) 1 hack would almost certainly work, but you never know when something comes along that breaks it | 19:20 |
| lekernel | if(p == NULL) foo(); else if(p == SPECIAL_X) bar(); else process_stuff_pointed_by_p(p); | 19:20 |
| lekernel | the (void *)1 hack also has the advantage that it would segfault if it gets deferenced due to some bug | 19:22 |
| lekernel | dereferenced | 19:22 |
| lekernel | instead of corrupting stuff and mysteriously crashing later on | 19:22 |
| wpwrak | looks like just allocating a different memory object would be the portable way to go. you can still #ifdef the (void *) 1 hack for catching dereferencing | 19:23 |
| lekernel | or can we use mmap()? | 19:23 |
| lekernel | and reserve a "no access" range for those special values | 19:23 |
| wpwrak | don't create complex dependencies ;-) | 19:23 |
| lekernel | oh it's not complex | 19:24 |
| lekernel | wasn't it you who said that MMU and mmap() was like a multiplier those days? :) | 19:24 |
| wpwrak | you'd be competing with malloc. yes, you can do that, but ... | 19:24 |
| lekernel | malloc() handles mmap'd regions nicely | 19:24 |
| wpwrak | sure. but it's this sort of things that get you in trouble when on "unusual" systems | 19:25 |
| wpwrak | there doesn't seem to be much of a need to go to extremes here, so why bother ? | 19:26 |
| lekernel | well, of course, this stifles the runnability of the LLHDL tools on MMU-less LM32 for self-reconfiguration ;) | 19:26 |
| wpwrak | see :) | 19:26 |
| lekernel | but i'm not even sure this would be usable anyway... maybe slow, and we need libgmp | 19:27 |
| lekernel | seems 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 addresses | 19:29 |
| lekernel | in a POSIX-compliant way | 19:29 |
| Fallenou | ahah the famous PROT_NONE used by go ? :p | 19:29 |
| wpwrak | lekernel: posix doesn't guarantee segfaults :) | 19:31 |
| lekernel | "PROT_NONE Pages may not be accessed." so what happens if you do? | 19:31 |
| lekernel | you get sig11, no? | 19:31 |
| lekernel | at least on all systems I know of | 19:31 |
| wpwrak | lekernel: "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 |
| wpwrak | lekernel: "If the Memory Protection option is not supported, the result of any access that conflicts with the specified protection is undefined." | 19:32 |
| lekernel | well, said protection is only really useful when debugging pointer bugs, right? | 19:33 |
| wpwrak | lekernel: yes, unless you start getting other ideas, such as your code depending on a signal handler to be called ;-) | 19:33 |
| lekernel | it's a simple command line tools that has little to do with signals... | 19:34 |
| wpwrak | lekernel: that would be the ultimate optimization - handle the special cases with the mmu ;-) | 19:34 |
| lekernel | and it would be pretty stupid to catch signal 11 anyway | 19:34 |
| wpwrak | but 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 quickly | 19:36 |
| wpwrak | (as in mmap not existing/returning an error) | 19:36 |
| kristianpaul | Fallenou: Are you awake/around? | 23:25 |
| Fallenou | yes ! | 23:26 |
| kristianpaul | I'm taking a look the the flicernoise code, and i noticed this | 23:27 |
| kristianpaul | sysettings.c:139: "e_login = new Entry()", | 23:27 |
| kristianpaul | sysettings.c:141: "e_password = new Entry(-blind yes)", | 23:27 |
| Fallenou | kristianpaul: have you tried forcing your ethernet card to work at 10 Mbps ? | 23:27 |
| kristianpaul | Fallenou: hmm not | 23:27 |
| Fallenou | to see if it prevents the rx fifo from becoming full ? | 23:27 |
| kristianpaul | hmm | 23:28 |
| Fallenou | it would be worth a try :) | 23:28 |
| kristianpaul | good point | 23:28 |
| kristianpaul | sure i will | 23:28 |
| Fallenou | ok thanks! | 23:28 |
| Fallenou | I tested ttcp | 23:28 |
| Fallenou | without any bug, as it seams i cannot reproduce the bug with qemu :/ | 23:28 |
| Fallenou | i will have to try to fix it blindly | 23:28 |
| kristianpaul | as soon i got te way to add a ftp user to flicernoise by commad | 23:28 |
| kristianpaul | ah you dont have a mm one.. | 23:28 |
| Fallenou | root does not work ? | 23:28 |
| Fallenou | no i don't :/ | 23:28 |
| kristianpaul | root got login but said 550 Acess denied as soon i try a ls | 23:29 |
| Fallenou | oh | 23:29 |
| Fallenou | strange | 23:29 |
| Fallenou | did you try ls /dev | 23:29 |
| Fallenou | ? | 23:29 |
| kristianpaul | no no | 23:30 |
| Fallenou | using the shell I can do such a ls | 23:30 |
| kristianpaul | i mean ftp ! | 23:30 |
| Fallenou | yes via the ftp | 23:30 |
| Fallenou | tu list the /dev | 23:30 |
| kristianpaul | root password rtems? | 23:30 |
| kristianpaul | or no password? | 23:30 |
| Fallenou | no password | 23:31 |
| Fallenou | if it is like the shell | 23:31 |
| kristianpaul | same thing... | 23:31 |
| kristianpaul | last time i tested after add a user using GUI but i'm going to do that again | 23:32 |
| kristianpaul | so i was digging how flickernoise added a ftp user | 23:32 |
| Fallenou | wow | 23:32 |
| Fallenou | using flickernoise in qemu, i got weird mouse movements | 23:33 |
| Fallenou | i just cannot use the GUI | 23:33 |
| Fallenou | the mouse is doing crazy stuff | 23:33 |
| kristianpaul | :\ | 23:33 |
| Fallenou | it is moving randomly everywhere while i move it | 23:33 |
| Fallenou | mwalle do you have such a behaviour ? | 23:33 |
| kristianpaul | can you TAB ? | 23:33 |
| Fallenou | no | 23:33 |
| Fallenou | does no do anything | 23:33 |
| kristianpaul | :-( | 23:33 |
| Fallenou | oh, now that i clicked on a button | 23:34 |
| Fallenou | i can tab | 23:34 |
| kristianpaul | phew | 23:34 |
| Fallenou | click works, if I happen to be on a button :) | 23:34 |
| Fallenou | but it is totally random where I move | 23:34 |
| kristianpaul | weird i remenber whe i was using qemu i dont have that behavior | 23:35 |
| kristianpaul | let me try | 23:35 |
| kristianpaul | Fallenou: i dint get GUI to boot, actually i just got flooded with "milkymist_memcard: read more cmd bytes than available. Clipping.".. | 23:43 |
| Fallenou | yes | 23:43 |
| Fallenou | I have been told that you have to create a file | 23:43 |
| Fallenou | empty file should do | 23:43 |
| Fallenou | like dd if=/dev/zero of=sdcard bs=1M count=30 | 23:43 |
| Fallenou | and then append -sd sdcard to qemu command line | 23:44 |
| Fallenou | it made my flickernoise boot :) | 23:44 |
| kristianpaul | my mouse cursor is okay here | 23:45 |
| Fallenou | oh ! | 23:46 |
| Fallenou | well let me restart my VM then :o | 23:46 |
| kristianpaul | VM is cheating ! | 23:46 |
| kristianpaul | ;-) | 23:46 |
| kristianpaul | poor qemu | 23:46 |
| kristianpaul | ;-) | 23:46 |
| Fallenou | =) | 23:48 |
| Fallenou | well I still have the problem | 23:48 |
| Fallenou | it's a really clean ubuntu VM | 23:48 |
| Fallenou | just installed to do RTEMS dev | 23:48 |
| Fallenou | I am using the touchpad :o | 23:48 |
| Fallenou | maybe it's the problem | 23:48 |
| Fallenou | but I don't have any mouse | 23:49 |
| Fallenou | and it used to work well with a touchpad before | 23:49 |
| kristianpaul | mtk is really simple :-) | 23:49 |
| kristianpaul | Is that a Mac? | 23:49 |
| Fallenou | anyway I still have 2 "read more cmd bytes" ... | 23:49 |
| Fallenou | yes | 23:49 |
| kristianpaul | do you understand what is for the lines of code i pointed before? | 23:50 |
| kristianpaul | I still not get how it change ftp in rtems to make that user and pass to login | 23:50 |
| kristianpaul | ah !, sysconfig_get_credentials(login, password); | 23:52 |
| Fallenou | :) | 23:54 |
| Fallenou | no i don't understand sorry | 23:54 |
| Fallenou | I have almost no knowledge of how flickernoise works | 23:54 |
| Fallenou | i mean MTK | 23:54 |
| kristianpaul | no no you dont | 23:54 |
| kristianpaul | need | 23:54 |
| kristianpaul | I think i found my answer | 23:55 |
| Fallenou | ok great ! | 23:55 |
| Fallenou | so root / nothing didn't work ? | 23:55 |
| kristianpaul | http://paste.debian.net/108129/ | 23:55 |
| kristianpaul | Fallenou: nope | 23:55 |
| Fallenou | oh, but the thing you just pasted indicate the use of the system login and pass , right ? | 23:55 |
| Fallenou | so it should be root / nothing :o | 23:56 |
| kristianpaul | no no, thats code is called when you set Remote Acess in System Settings (flickernoise gui) | 23:56 |
| kristianpaul | dunno why root is not allowed | 23:57 |
| Fallenou | oh ok | 23:57 |
| kristianpaul | actually i did log in my a foo user and is same behavior.. | 23:57 |
| kristianpaul | Fallenou: http://paste.debian.net/108130/ | 23:59 |
| Action: Fallenou watches a battelstar galactica | 23:59 | |
| kristianpaul | hehe | 23:59 |
| Fallenou | or my head is gnna explose | 23:59 |
| kristianpaul | ok good | 23:59 |
| Fallenou | week has been hard | 23:59 |
| --- Sat Feb 19 2011 | 00:00 | |
Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!