Author Topic: Calling all Linux Kernel developers!  (Read 392508 times)

0 Members and 5 Guests are viewing this topic.

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #630 on: January 25, 2013, 07:29:40 am »
Isn't the boot2 programmed into the nand?
How does it get loaded then? Would boot1 be easier to rev-eng if it needs to access the flash?

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Calling all Linux Kernel developers!
« Reply #631 on: January 25, 2013, 07:32:28 am »
Quote
Isn't the boot2 programmed into the nand?
Yup, it is, but in an area that is not written to by FS operations, and cannot therefore be corrupted by FS operations performed at too high a AHB clock rate.
Quote
How does it get loaded then?
Loaded by the boot1, yup.
Quote
Would boot1 be easier to rev-eng if it needs to access the flash?
For mere NAND Flash memory access, indeed, it's easier than the boot2.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: Calling all Linux Kernel developers!
« Reply #632 on: January 25, 2013, 08:12:15 am »
There is no trace of FlashFX nor Datalight in the boot1. Indeed, yesterday I picked up the wrong file (boot1) and searched for what Lionel was saying about the fact the boot2 loads the OS from the FS. I turned in round during 10 minutes until I noticed the title of my window...
In case the boot1 actually uses FlashFX, TI has removed all the constant strings, but why did they let all the asserts in the boot2 then ?

So as Lionel said, I don't think the boot2 is actually written in the FS part.

Also, boot2 is "simple" to rev-eng compared to the OS (as said someone previously). Futhermore, as I said, TI has let a bunch of assertions keeping the name of the files.
Since we have the source now, one can simply look at the source code and the disassembly and tell which function to call.
« Last Edit: January 25, 2013, 08:15:29 am by Levak »
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Calling all Linux Kernel developers!
« Reply #633 on: January 25, 2013, 08:17:45 am »
The boot1 does not contain FlashFX / Datalight Reliance code, FS handling is definitely left to the boot2.
The manufacturer data, boot2, diags are stored in well-defined areas, see PolyDumper / nsNandMgr.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #634 on: January 25, 2013, 07:16:57 pm »
I'm not surprised. I'd expect the boot1 to just be hardcoded to read boot2 as-is from its place in flash. No need for filesystem access.

Offline tangrs

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 229
  • Rating: +98/-0
    • View Profile
    • tangrs blog
Re: Calling all Linux Kernel developers!
« Reply #635 on: January 26, 2013, 01:54:55 am »
NAND driver is coming along slowly. I got it to detect the chip properly at the very least. :D


Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Calling all Linux Kernel developers!
« Reply #636 on: January 26, 2013, 02:49:23 am »
Indeed, but then there's a problem :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline tangrs

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 229
  • Rating: +98/-0
    • View Profile
    • tangrs blog
Re: Calling all Linux Kernel developers!
« Reply #637 on: January 26, 2013, 05:32:51 am »
Woo!



NAND driver can be found in a separate tree on Github.

It detects the same two bad blocks on my NAND that diags detects but other than that, I haven't tested the driver at all. Anyone up to be a guinea pig and potentially screw up their NAND? :P

Also, no ECC support. Does anyone know the ECC settings?
« Last Edit: January 26, 2013, 05:33:14 am by tangrs »

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #638 on: January 26, 2013, 05:52:49 am »
I don't want to lose my loved boot2 ;)
Does is work in nspire emu?
You could easily compare the image with your bytes read.

Offline tangrs

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 229
  • Rating: +98/-0
    • View Profile
    • tangrs blog
Re: Calling all Linux Kernel developers!
« Reply #639 on: January 26, 2013, 06:13:01 am »
I don't want to lose my loved boot2 ;)
Does is work in nspire emu?
You could easily compare the image with your bytes read.

Weird. It's the same but the bytes are reversed. :S

Never mind. Wrong parameters to hexdump.

Now, how should I test write support without killing it?
« Last Edit: January 26, 2013, 06:14:35 am by tangrs »

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #640 on: January 26, 2013, 07:01:53 am »
Quote
Now, how should I test write support without killing it?
Use nspire_emu, even I wasn't able to brick it ;-)
If it works, test it on real hardware (Please do it, I don't want to brick mine :-) )
We really need to get linux running with nspire_emu, that would make thing
a lot easier

Offline tangrs

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 229
  • Rating: +98/-0
    • View Profile
    • tangrs blog
Re: Calling all Linux Kernel developers!
« Reply #641 on: January 26, 2013, 07:23:58 am »
Quote
Now, how should I test write support without killing it?
Use nspire_emu, even I wasn't able to brick it ;-)
If it works, test it on real hardware (Please do it, I don't want to brick mine :-) )
We really need to get linux running with nspire_emu, that would make thing
a lot easier

Just emailed you something that may be of interest. Linux doesn't run on nspire_emu right now though :(

I also added MTD partitions into the mix so you can dump your boot2 and diags via Linux if you really wanted to (USB Mass Storage eh?). The partitions are all marked read-only so it *shouldn't* be possible to brick your device. Also, beware, you might get some non-errorcorrected data since ECC isn't available right now.

As to testing write support, maybe I'll mark the filesystem partition writable, read a few bytes and save them, then write some garbage and call sync. If I read the bytes and they are the same garbage values as I wrote, then it works (then restoring the bytes). The worst that can happen is that I have to reinstall the OS :P

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #642 on: January 26, 2013, 07:34:31 am »
Quote
Just emailed you something that may be of interest. Linux doesn't run on nspire_emu right now though
I read it, but seems to be not very useful :-(

Quote
I also added MTD partitions into the mix so you can dump your boot2 and diags via Linux if you really wanted to
Could you implement one for the filesystem, too?
I'd experiment a bit with flashfx support. (Which seems to be harder than reliance)

Quote
The worst that can happen is that I have to reinstall the OS
Actually (but not very likely) you could damage boot2 if you write to the wrong bytes.

Offline tangrs

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 229
  • Rating: +98/-0
    • View Profile
    • tangrs blog
Re: Calling all Linux Kernel developers!
« Reply #643 on: January 26, 2013, 07:46:35 am »
Quote
Just emailed you something that may be of interest. Linux doesn't run on nspire_emu right now though
I read it, but seems to be not very useful :-(

Quote
I also added MTD partitions into the mix so you can dump your boot2 and diags via Linux if you really wanted to
Could you implement one for the filesystem, too?
I'd experiment a bit with flashfx support. (Which seems to be harder than reliance)

Quote
The worst that can happen is that I have to reinstall the OS
Actually (but not very likely) you could damage boot2 if you write to the wrong bytes.

You'll find that the filesystem partition already exists. I assumed the filesystem comes after diags (hence the question mark in the mtd partition list).

As to writing to boot2 accidentally, that should be mitigated because of partitioning. Linux won't let you write to something outside it's partition range.

Edit: Heh :P

@Vogtinator, we could use this to write a read-only filesystem driver for FlashFX and Reliance? http://ourl.ca/99835
« Last Edit: January 26, 2013, 08:31:38 am by tangrs »

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #644 on: January 26, 2013, 12:28:41 pm »
Quote
Edit: Heh
There were at least 3 discussions about linux before you began working on it :D

Quote
@Vogtinator, we could use this to write a read-only filesystem driver for FlashFX and Reliance? http://ourl.ca/99835
I already added this page to my favourites three days ago ;)
The part about reliance is useless, "INOD" is actually just a tiny part of the whole:
http://ftp.icpdas.com/pub/beta_version/WinPac-8000/flashfx/dcl/common/loader/reliance/dlrelcore.h
Sadly they use FlashFX Tera instead of FlashFX Pro 3.0, but vfbdump.c seems to support both.

Daniel, you forgot to add include/linux/mtd/nspire_cx_nand.h :(
« Last Edit: January 26, 2013, 01:16:40 pm by Vogtinator »