--- Log opened Sat May 21 00:29:43 2011 00:29 -!- Keripo [~Keripo@c-76-28-198-27.hsd1.wa.comcast.net] has joined #freemyipod 01:02 -!- k1ddyt3ch [~techno@host86-147-48-126.range86-147.btcentralplus.com] has left #freemyipod 01:06 -!- kleemajo [~kleemajo@host176-169.resnet.ubc.ca] has quit [Remote host closed the connection] 02:21 -!- [7] [~TheSeven@rockbox/developer/TheSeven] has quit [Disconnected by services] 02:21 -!- TheSeven [~TheSeven@rockbox/developer/TheSeven] has joined #freemyipod 04:19 -!- posixninja [~textual@h177.56.23.98.dynamic.ip.windstream.net] has quit [Quit: Computer has gone to sleep.] 05:00 -!- clustur [~logger@c-98-249-104-118.hsd1.tn.comcast.net] has quit [Remote host closed the connection] 05:00 -!- clustur [~logger@c-98-249-104-118.hsd1.tn.comcast.net] has joined #freemyipod 05:48 -!- S_a_i_n_t [~st.lasciv@124-197-3-117.callplus.net.nz] has quit [Ping timeout: 276 seconds] 05:52 -!- [Saint] [~st.lasciv@124-197-3-117.callplus.net.nz] has joined #freemyipod 07:15 -!- n1s [~quassel@rockbox/developer/n1s] has joined #freemyipod 08:19 -!- n1s [~quassel@rockbox/developer/n1s] has quit [Remote host closed the connection] 10:01 -!- hiddeboomsma [~hiddeboom@lkt.hostnet.nl] has left #freemyipod 11:00 -!- clustur [~logger@c-98-249-104-118.hsd1.tn.comcast.net] has quit [Remote host closed the connection] 11:00 -!- clustur [~logger@c-98-249-104-118.hsd1.tn.comcast.net] has joined #freemyipod 11:36 -!- Keripo [~Keripo@c-76-28-198-27.hsd1.wa.comcast.net] has quit [Quit: Leaving.] 11:39 -!- benedikt93 [~benedikt9@unaffiliated/benedikt93] has joined #freemyipod 13:14 -!- liar [~liar@clnet-p09-185.ikbnet.co.at] has joined #freemyipod 16:02 < TheSeven> user890104: just read your beeper source code 16:02 < TheSeven> copying the song to the stack seems to be a bad idea to me 16:06 < user890104> what's your suggestion? 16:07 < user890104> i don't really have much expreience in embedded software development, i would do it that way if it runs on a computer 16:16 -!- user890104 [Venci@venci-notebook-lan.ipv6.6bez10.info] has quit [] 17:00 -!- clustur [~logger@c-98-249-104-118.hsd1.tn.comcast.net] has quit [Remote host closed the connection] 17:00 -!- clustur [~logger@c-98-249-104-118.hsd1.tn.comcast.net] has joined #freemyipod 17:32 -!- [Saint] [~st.lasciv@124-197-3-117.callplus.net.nz] has quit [Disconnected by services] 17:32 -!- S_a_i_n_t [~st.lasciv@124-197-3-117.callplus.net.nz] has joined #freemyipod 17:32 -!- benedikt93_ [~benedikt9@p5B0C47BB.dip.t-dialin.net] has joined #freemyipod 17:32 -!- benedikt93 [~benedikt9@unaffiliated/benedikt93] has quit [Disconnected by services] 17:33 -!- benedikt93_ is now known as benedikt93 17:33 -!- benedikt93 [~benedikt9@p5B0C47BB.dip.t-dialin.net] has quit [Changing host] 17:33 -!- benedikt93 [~benedikt9@unaffiliated/benedikt93] has joined #freemyipod 17:36 -!- Keripo [~Keripo@c-76-28-198-27.hsd1.wa.comcast.net] has joined #freemyipod 17:40 -!- Keripo [~Keripo@c-76-28-198-27.hsd1.wa.comcast.net] has quit [Ping timeout: 246 seconds] 18:10 -!- posixninja [~textual@h177.56.23.98.dynamic.ip.windstream.net] has joined #freemyipod 19:19 -!- user890104 [~Venci@212.233.188.54] has joined #freemyipod 19:23 < yuriks> benedikt93: is the nano3 sdram working already? (I'm not the same one who asked the other day, but also interested) 19:24 < benedikt93> yuriks, user890104 19:24 < benedikt93> ... 19:25 < benedikt93> damn, I didn't yet want to hit enter 19:25 < yuriks> yeah? 19:25 < yuriks> oh, xD 19:26 < benedikt93> fact is, that the i2c part of it never worked because I somehow failed at imitating apple's code, but I might go through this again (I never actually needed sdram, so I didn't reallly bother) 19:27 < benedikt93> TheSeven, or did you fix it in the meantime? 19:27 < benedikt93> I might also just copy&paste what TheSeven wrote for emcore on the classics 19:28 < yuriks> he said he had no idea if it worked (asked me to ask you) 19:29 * benedikt93 thought for some time that his sdram init *did* work, as it apparently is enough to setup the memory controller when the ipod only was in standby before 19:29 < benedikt93> I might just fix the i2c part first 19:30 < yuriks> ah, so it isn't a complete setup, just for wake up? 19:31 < benedikt93> it is complete, but when booting from standby, it doesn't matter when the code setting up the pmu fails, as the sdram seems to still be powered at that time 19:31 < benedikt93> (the pmu is connected by i2c) 19:32 < yuriks> ah, I see 19:33 < benedikt93> you own a Nano 3G, too? 19:33 < yuriks> yeah 19:33 < yuriks> I'm free for any testing 19:33 < yuriks> (that doesn't involve bricking or wiping it out too routinely :) 19:33 < user890104> i have a nano3g, too 19:33 < user890104> that's why i asked 19:35 < yuriks> is the official ARM ABI the one used for most things? 19:35 < yuriks> (in the ARM world, no ipod specifically) 19:35 < yuriks> not* 19:44 < TheSeven> nowadays probably the EABI 19:46 < yuriks> I'm doing some bare arm coding right now and am mostly just making up my own stuff based from my experience with x86 :P, specially with regards to the stack 19:46 < yuriks> results are probably being horrible 20:16 < TheSeven> yuriks: can you show me some example? 20:16 < TheSeven> if there are some misunderstandings about the platform, i could probably point you to those if I see your code 20:22 < user890104> TheSeven: why have you used memalign instead of malloc when allocating memory to fit a file from libboot 20:22 < user890104> and do i need to use it for allocating my arrays of integers? 20:23 < TheSeven> you should use memalign for all buffers that do any kind of I/O 20:24 < TheSeven> otherwise the I/O apis may either fail to work properly (intermittent failures, really nasty), reject the request, panic, or do copying to an aligned buffer internally 20:25 < TheSeven> this does not apply to all I/O, but to everything that uses DMA in one or another way 20:25 < TheSeven> that's USB, SPI, NAND, ATA, MMC, I2S and probably some more things 20:25 < TheSeven> I2C is the only thing that comes to my mind that doesn't do DMA 20:27 -!- user890104 [~Venci@212.233.188.54] has quit [Remote host closed the connection] 20:27 < yuriks> TheSeven: http://pastebin.com/eqRuSpMW http://pastebin.com/b4M5yftw http://pastebin.com/t8C0jarD 20:27 < yuriks> that's some of the code I've wrote 20:28 < yuriks> I'm mainly not sure how to do stack variables 20:29 < TheSeven> heh 20:29 * TheSeven got used to -fomit-frame-pointer 20:29 < TheSeven> i can't even remember how the frame pointer is usually used on ARM 20:29 -!- liar [~liar@clnet-p09-185.ikbnet.co.at] has quit [Ping timeout: 258 seconds] 20:29 -!- user890104 [~Venci@6bez10.info] has joined #freemyipod 20:29 < TheSeven> in fact i've never seen it being used in any code that i've disassembled 20:30 < TheSeven> and substracting #11 from the stack pointer doesn't seem like a good idea 20:30 < TheSeven> you should align that to the next 4-byte boundary 20:30 < yuriks> oh, you're right 20:31 < yuriks> stupid emulators, not crashing on me :P 20:31 -!- liar [~liar@clnet-p09-185.ikbnet.co.at] has joined #freemyipod 20:32 < TheSeven> that won't neccessarily crash, but i might do very weird things(tm) 20:32 < TheSeven> things will start wrapping around 20:32 < yuriks> yeah 20:32 < yuriks> it's probably fine here cause I'm not using the stack for anything else 20:32 < yuriks> (I'm saving register on it, but I'm not using those regs later anyway) 20:34 < yuriks> (fine? I meant 'working' :P) 20:34 < TheSeven> anyway, the code seems to be ABI compatible 20:35 < TheSeven> however you're doing some things in a weird way 20:35 < yuriks> like what? 20:35 < TheSeven> usually LR is saved on entry, used as a scratch register in the function (as function calls will corrupt it anyway) and then restored into PC on exit 20:36 < TheSeven> you're leaving LR alone, not calling any subfunctions, and allocating some other scratch register instead 20:36 < TheSeven> this is of course compatible, but not the way things are usually done 20:36 < yuriks> oh, that's a nice trick 20:36 < TheSeven> beware that this trick breaks thumb compatibility on older ARM cores 20:37 < yuriks> this is gonna run on a custom ARM-compatible cpu without thumb support anyway :P 20:37 < TheSeven> (you need a BX instruction to properly return to/from thumb mode on them, and an LDMxy won't work) 20:37 < TheSeven> ok, no need to care about that then 20:38 < TheSeven> another thing that's just a convention and doesn't even affect the output binary is the LDM/STM notation you're using 20:39 < TheSeven> DA/DB/IA/IB are usually used for general purpose read/write operations, and the equivalent EA/ED/FA/FD mnemonics are used for stack operations 20:39 < TheSeven> that's just to make the code more readable 20:39 < TheSeven> STMFD == STMDB, LDMFD == LDMIA 20:40 < yuriks> hmm 20:40 < TheSeven> so you can use the same suffix everywhere you're accessing the stack, depending only on the stack type 20:40 < TheSeven> and you'll usually use an FD stack (full descending) 20:41 < yuriks> apparently there are push/pop mnemonics too (for stmfd/ldmfd) 20:41 < TheSeven> yeah, those are actually thumb mnemonics, which are usually translated by the assembler when writing ARM mode code 20:43 < yuriks> thanks for the pointers :) 20:44 < TheSeven> but yeah, you're doing really good so far :) 20:45 < TheSeven> it seems to me like you have never written ARM code before, but know quite a lot of ARM theory (have read their ARM/TRMs) and have assembly programming background from some other architecture 20:45 < yuriks> and that would be correct 20:46 < yuriks> I know x86, a tiny bit of 68k. And have read the architecture spec (and this one http://nocash.emubase.de/gbatek.htm#cpuoverview) a bunch of times 20:56 < fmibot_> New commit by user890104 (r715): Beeper: optimize memory allocation a bit 20:57 < fmibot_> r715 build result: emcore: All green! 20:58 < TheSeven> user890104: why are you copying this stuff around at all? 20:59 < TheSeven> i can't see any reason why you couldn't play directly from the input buffer 21:09 < Farthen> TheSeven: does ++i in a for loop have any impact? shouldn't it be i++? 21:09 < yuriks> it increments i 21:09 < Farthen> sure but does it have any impact if you prefix ++ in a for loop? 21:09 < TheSeven> ++i == pre-increment, i++ == post-increment 21:09 < Farthen> yes, sure 21:09 < yuriks> outside of a more complex expression ++i and i++, except for i++ being slower if the compiler is dumb 21:09 < Farthen> again, does that have any impact if used in a for loop? 21:09 < yuriks> are the same* 21:10 < Farthen> ok 21:10 < TheSeven> if you mean the third argument of a for statement, it doesn't matter (personal preference) 21:10 < TheSeven> in some other places it does 21:10 < Farthen> ok 21:10 < Farthen> i was referring to user890104's code and i have never seen ++i in a for loop yet, that's why i was asking 21:11 < yuriks> it's pretty common in C++ code 21:12 < yuriks> (where i may be an iterator instead of a simple int, and thus i++ may have different semantics (if the library writer hates you) than ++i 21:15 < user890104> TheSeven: i don't know how to use the data in the form i loaded it so i split it to two arrays 21:16 < benedikt93> you might access it by some simple struct 21:17 < TheSeven> either that, or just by the pointers that you used to copy it into the array 21:17 < benedikt93> struct tone { uint8_t cycles, uint8_t length } 21:18 < benedikt93> and then cast the file pointer to a pointer to such struct 21:18 < Farthen> IMHO that would be the most clean solution to that 21:18 < Farthen> because it makes the following code easy to understand 21:19 < user890104> yeah, i'll try it then 21:19 < yuriks> is the status page on the wiki up-to-date re. the 3G? 21:19 < Farthen> or rather a pointer to an array of such structs, wouldn't it? 21:20 < benedikt93> wouldn't that basically be the same? 21:20 < yuriks> one extra level of indirection 21:20 < yuriks> that's not really needed... 21:21 < Farthen> i don't know but you may be right, yes 21:21 < Farthen> difference would be that you would need to increment the pointer by sizeof(struct) every time 21:22 < Farthen> which my be slower than using an array 21:22 < Farthen> (because it has to do sizeof every time) 21:22 < TheSeven> eh? 21:22 < yuriks> but you need the sizeof for the array too... 21:22 < Farthen> whops 21:22 < benedikt93> I thought it the other way around, beacause it would multiply always when using an array 21:22 < TheSeven> the difference would be an extra pointer on the stack and an extra dereference 21:23 < yuriks> benedikt93: that's free also 21:23 < yuriks> since the multiply is just a shift 21:23 < TheSeven> Farthen: you can just pass arrays as arguments in C 21:23 < benedikt93> is the status page on the wiki up-to-date re. the 3G? <-- yep 21:23 < TheSeven> yuriks: nah, if it's clever, the compiler can completely eliminate it 21:24 < Farthen> TheSeven: yes? what was the point of you telling me that? 21:24 < TheSeven> Farthen: and sizeof is not a function, but a compile-time evaluated constant 21:24 < yuriks> TheSeven: oh, yeah, but even if it doesn't, that kind of base + index * power_of_2 sort of adressing is free on ARM 21:25 < TheSeven> assuming r0 = data pointer, r1 = size: 21:25 < TheSeven> loop: 21:25 < yuriks> though I guess you use an extra register 21:26 < TheSeven> ldmia r0!, {r2, r3} 21:26 < TheSeven> 21:26 < TheSeven> subs r1, r1, #8 21:26 < TheSeven> bne loop 21:26 < yuriks> oh, multiple load 21:26 < TheSeven> well, or two ldr rX, [r0], #4 instructions 21:27 < yuriks> yeah 21:55 -!- benedikt93 [~benedikt9@unaffiliated/benedikt93] has quit [Quit: "Facts do not cease to exist because they are ignored." - Aldous Huxley] 22:02 -!- user890104 [~Venci@6bez10.info] has quit [Ping timeout: 252 seconds] 22:34 -!- liar [~liar@clnet-p09-185.ikbnet.co.at] has quit [Ping timeout: 258 seconds] 22:36 -!- user890104 [Venci@venci-notebook-lan.ipv6.6bez10.info] has joined #freemyipod 22:51 < fmibot_> New commit by user890104 (r716): Beeper: use less memory 22:51 < fmibot_> r716 build result: emcore: All green! 22:52 * user890104 thinks that his app is pretty much complete for now 22:53 < user890104> i'm thinking about writing a file manager that runs on the device itself 22:57 -!- liar [~liar@clnet-p09-185.ikbnet.co.at] has joined #freemyipod 23:00 -!- clustur [~logger@c-98-249-104-118.hsd1.tn.comcast.net] has quit [Remote host closed the connection] 23:00 < yuriks> heh, I still remember how to run code on my 3g :P 23:00 -!- clustur [~logger@c-98-249-104-118.hsd1.tn.comcast.net] has joined #freemyipod 23:28 -!- bairchan [~boromir@pool-72-70-187-188.hrbgpa.fios.verizon.net] has quit [Ping timeout: 240 seconds] 23:29 -!- bairchan [~boromir@pool-72-70-187-188.hrbgpa.fios.verizon.net] has joined #freemyipod 23:47 < yuriks> is there a way to tell IDA to treat unknown data as dwords instead of bytes? (Or to mass tag some memory as being dwords) --- Log closed Sun May 22 00:08:07 2011