Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
23 May, 2013, 22:22:36 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 2 [3] 4 5 ... 23   Go Down
  Print  
Author Topic: nSDL 1.1.1 Anniversary Edition—The Ultimate TI-Nspire Graphics Library! -  (Read 15297 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Lionel Debroux
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 19:43:41
Date Registered: 17 December, 2009, 09:37:25
Location: France
Posts: 1854

Total Post Ratings: +208

View Profile WWW
« Reply #30 on: 11 February, 2012, 18:34:21 »
0

You should switch to GCC 4.6.2, lkj: all "x.y.0" releases of GCC contain quite a few significant bugs Smiley
(though the last major disaster "x.y.0" release was GCC 4.0.0, i.e. years ago)
Logged

Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.
lkj
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Today at 00:31:23
Date Registered: 07 September, 2011, 20:05:25
Posts: 350

Total Post Ratings: +40

View Profile
« Reply #31 on: 11 February, 2012, 19:26:51 »
0

I never saw any bug, but I switched as you suggested.
I thought updating would be as complicated as setting up the ndless-SDK, but it was very easy Smiley
Logged

My Nspire Ndless C projects:
hoffa
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Today at 16:11:27
Date Registered: 28 May, 2011, 20:26:32
Posts: 302


Topic starter
Total Post Ratings: +115

View Profile
« Reply #32 on: 11 February, 2012, 20:20:19 »
0

Could somebody quickly check my code, it doesn't seem to print the value of f. Either I'm using nl_relocdata wrong, or then I'm too tired and am missing something silly.

http://pastebin.com/N2iiUhd1

That's more or less how SDL behaves at one point, and it's reallocating the function pointer that causes issues. The strings print out fine, calling the function doesn't work though.

EDIT: I've tried everything I can think of. Am I really missing something here or is there no way to use nl_relocdata on a pointer to a function? (I doubt it, even in the wiki it is mentioned)
« Last Edit: 12 February, 2012, 00:37:37 by hoffa » Logged
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: Today at 10:41:36
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765

Total Post Ratings: +151

View Profile
« Reply #33 on: 12 February, 2012, 13:25:10 »
0

Things are getting complicated in your case, nl_relocdata was introduced to handle simpel cases, sorry about that.

I unfortunately cannot test them on this computer, but here are a few corrections:

- nl_relocdata((unsigned int *)bootstrap, sizeof(bootstrap) / sizeof(bootstrap[0]));: I'm not sure relocating NULL is a good idea. Use nl_relocdata((unsigned int *)bootstrap, 1); instead.
- nl_relocdata((unsigned int *)bootstrap[0]->fp, sizeof(void *));: Use nl_relocdata((unsigned int *)bootstrap[0]->fp, 1);

But anyway I'm not sure this will fix your error, I'll look further into this as soon as possible.
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
hoffa
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Today at 16:11:27
Date Registered: 28 May, 2011, 20:26:32
Posts: 302


Topic starter
Total Post Ratings: +115

View Profile
« Reply #34 on: 12 February, 2012, 13:56:42 »
0

Thanks, but it unfortunately did not fix it. What exactly does size refer to--what size does it refer to (in bytes I presume)? I'll experiment around a bit, but if there is no solution yet I will kindly wait for any future developments.

EDIT:
What do you mean relocating NULL? bootstrap is not NULL, nor is the quotient equal to zero.
« Last Edit: 12 February, 2012, 14:01:15 by hoffa » Logged
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: Today at 10:41:36
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765

Total Post Ratings: +151

View Profile
« Reply #35 on: 12 February, 2012, 14:17:16 »
0

But bootstrap contains a NULL value, I'm not sure I'm skipping NULL values.

nl_relocdata relocates an array of pointers (it should work as well on entire structures containing only pointers). The second parameter corresponds to the number of pointers to relocate.
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
alberthrocks
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Last Login: 11 May, 2013, 04:49:27
Date Registered: 01 May, 2010, 16:51:27
Posts: 743

Total Post Ratings: +88

View Profile
« Reply #36 on: 12 February, 2012, 19:02:17 »
0

Hmm... how hard will it be to write a BLFT loader? It seems that this project (and possibly many others) might need one.
It has code relocation and is much smaller than the ELF loader.

(If it isn't too hard, I might attempt to write one Tongue Seems that one would need to know ARM ASM to do it... which I don't know)
Logged

Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! Sad Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. Smiley

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler for "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it Tongue)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it Tongue)
wxWabbitemu: 40% done (NEED MOAR FEATURES Tongue)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming Tongue)
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: Today at 10:41:36
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765

Total Post Ratings: +151

View Profile
« Reply #37 on: 12 February, 2012, 20:06:14 »
0

Lionel Debroux has just started a port of the Linux implementation, he will post more about it.
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
Lionel Debroux
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 19:43:41
Date Registered: 17 December, 2009, 09:37:25
Location: France
Posts: 1854

Total Post Ratings: +208

View Profile WWW
« Reply #38 on: 12 February, 2012, 20:38:30 »
+2

I have indeed started looking at what pieces need to be changed for porting Linux's bFLT loader (fs/binfmt_flat.c + include/linux/flat.h + arch/arm/include/asm/flat.h) to non-Linux OS running on the Nspire. And a quick examination (<1h) shows dozens of places that need to be adjusted; it's not necessarily very hard to do so, for the most part, it's just that someone needs to spend time doing it, and I don't have time to undertake such a task alone - for a start, not this evening.

ExtendeD has suggested looking at QEMU's loader (linux-user/flatload.c), which looks slightly more portable than Linux's loader. It remains quite tied to Linux/QEMU internals, and may or may not be a better starting point than Linux's loader: unlike Linux's loader, QEMU's loader's support for compressed binaries and for libraries is explicitly disabled - and we clearly want both, probably with a higher priority on libraries. Support for compressed bFLT binaries wouldn't cost much space in the loader, since we can (well, "ought to be able to") rely on the zlib functions embedded in the OS.

Quote
Seems that one would need to know ARM ASM to do it
I doubt that it's necessary: AFAICT, the bFLT loaders in Linux and QEMU are plain C Smiley


EDIT: here's the current state of the stuff. As you can see, I haven't changed the code yet, and won't do tonight. The tarball is made of five files:
* binfmt_flat_mod.c is Linux's bFLT loader, annotated with a bunch of TODOs on parts that we need to remove or port;
* binflt_flat.diff is the diff against the pristine file;
* the two headers are include/linux/flat.h and arch/arm/include/asm/flat.h;
* flatload.c is QEMU's bFLT loader.

* linux_and_qemu_bflt_loaders.tar.bz2 (15.5 KB - downloaded 12 times.)
« Last Edit: 12 February, 2012, 21:31:16 by Lionel Debroux » Logged

Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: Today at 10:41:36
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765

Total Post Ratings: +151

View Profile
« Reply #39 on: 14 February, 2012, 22:40:59 »
0

Could somebody quickly check my code, it doesn't seem to print the value of f. Either I'm using nl_relocdata wrong, or then I'm too tired and am missing something silly.

http://pastebin.com/N2iiUhd1

That's more or less how SDL behaves at one point, and it's reallocating the function pointer that causes issues. The strings print out fine, calling the function doesn't work though.

EDIT: I've tried everything I can think of. Am I really missing something here or is there no way to use nl_relocdata on a pointer to a function? (I doubt it, even in the wiki it is mentioned)

Here it is fixed: http://pastebin.com/ELBkWJMt
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
hoffa
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Today at 16:11:27
Date Registered: 28 May, 2011, 20:26:32
Posts: 302


Topic starter
Total Post Ratings: +115

View Profile
« Reply #40 on: 15 February, 2012, 17:50:55 »
0

Oh wow, thanks. I'm quite surprised as I tried the same code as you except without the &-operator; I thought prefixing a function name with the ampersand was optional, both should return the address of the said function AFAIK.

EDIT:
This is great news as I'm now able to initialize the barebone video driver:

« Last Edit: 16 February, 2012, 00:17:38 by hoffa » Logged
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: Today at 10:41:36
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765

Total Post Ratings: +151

View Profile
« Reply #41 on: 15 February, 2012, 19:32:16 »
0

Good Smiley

Here the address of the field that contains the function pointer is expected, so the & is required.
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: Today at 10:41:36
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765

Total Post Ratings: +151

View Profile
« Reply #42 on: 15 February, 2012, 19:48:09 »
0

Good Smiley

Here the address of the field that contains the function pointer is expected, so the & is required.
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Online Online

Gender: Male
Last Login: Today at 21:55:27
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #43 on: 15 February, 2012, 23:38:25 »
0

Nice to see the progress!
Logged

DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 18:03:25
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50227


Total Post Ratings: +2615

View Profile WWW
« Reply #44 on: 16 February, 2012, 06:48:27 »
0

Good to hear hoffa. Hopefully this gets finished eventually. Cheesy
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Pages: 1 2 [3] 4 5 ... 23   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.319 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.