Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: what should happen? #3

Open
philtomson opened this issue Jun 21, 2014 · 6 comments
Open

Documentation: what should happen? #3

philtomson opened this issue Jun 21, 2014 · 6 comments

Comments

@philtomson
Copy link

I managed to build the kernel.img on my RPi and then copied it to a Raspian SD card (replacing the one that was in /boot/kernel.img). Then I plugged that SD card into the RPI and started it up. I saw the RPi bootup screen (for recovery mode press shift) and then that went blank and... nothing.

@mrvn
Copy link
Owner

mrvn commented Jun 26, 2014

On Sat, Jun 21, 2014 at 03:41:56PM -0700, Phil Tomson wrote:

I managed to build the kernel.img on my RPi and then copied it to a Raspian SD card (replacing the one that was in /boot/kernel.img). Then I plugged that SD card into the RPI and started it up. I saw the RPi bootup screen (for recovery mode press shift) and then that went blank and... nothing.


Reply to this email directly or view it on GitHub:
#3

Anything on the serial console?

MfG
Goswin

@philtomson
Copy link
Author

Finally got around to trying out the serial console. This is what I'm seeing (It doesn't let me login) :
Uncompressing Linux... done, booting the kernel.

Welcome to the rescue system
recovery login:
Welcome to the rescue system
recovery login:

@mrvn
Copy link
Owner

mrvn commented Jul 4, 2014

On Wed, Jul 02, 2014 at 02:23:23PM -0700, Phil Tomson wrote:

Finally got around to trying out the serial console. This is what I'm seeing (It doesn't let me login) :
???
Welcome to the rescue system
recovery login:
Welcome to the rescue system
recovery login:

Then you aren't booting ocaml-rpi.

MfG
Goswin

@philtomson
Copy link
Author

Ok, so here's what I did:

  1. I ran your Makefile on the rPi to get the kernel.img
  2. I duplicated a Raspian SD card with dd & then mounted the resulting microSD card.
  3. Then I copied the kernel.img from (1) to the duplicate Raspian in the boot mount point replacing the one that was there.

I notice that there is a kernel_emergency.img in that boot folder, so apparently that's what's trying to boot - possibly because it doesn't like the kernel.img that was created from ocaml-rpi?

Also, I just grepped for "Hello World" in the kernel.img that was generated and it does find the string in there.

@mrvn
Copy link
Owner

mrvn commented Jul 11, 2014

On Fri, Jul 04, 2014 at 08:48:24AM -0700, Phil Tomson wrote:

Ok, so here's what I did:

  1. I ran your Makefile on the rPi to get the kernel.img
  2. I duplicated a Raspian SD card with dd & then mounted the resulting microSD card.
  3. Then I copied the kernel.img from (1) to the duplicate Raspian in the boot mount point replacing the one that was there.

I notice that there is a kernel_emergency.img in that boot folder, so apparently that's what's trying to boot - possibly because it doesn't like the kernel.img that was created from ocaml-rpi?

Also, I just grepped for "Hello World" in the kernel.img that was generated and it does find the string in there.


Reply to this email directly or view it on GitHub:
#3 (comment)

I might have found the problem: I tested a lot on qemu and that loads
the kernel image at 0x10000 instead of 0x8000 like a real RPi. This
ended up in the git repository. So in

https://github.com/mrvn/ocaml-rpi/blob/master/link-arm-eabi.ld

line 26 should read:

. = 0xC0008000;

96725a7

MfG
Goswin

@philtomson
Copy link
Author

I tried with your latest update and it does seem to do more than it did previous, but seems to be some kind of exception now:

Uncompressing Linux... done, booting the kernel.

Welcome to the rescue system
recovery login:
# uart initialized
_end = 0xC0180000
model = 0xc42 [expected 0xc42]
atags @ 0x00000100
memory size = 0x1c000000
memory_init(0xC0180000, 0x1be80000) : adding chunk 0x1be7ffcc [28]
# stack = 0xC016BFE7
# exception vector set
# enabling IRQs
000000
# doubles tested
strtol("foo", NULL, 0) = 0, errno = 22
strtol("0", NULL, -1) = 0, errno = 22
strtol("0", NULL, 1) = 0, errno = 22
strtol("0", NULL, 37) = 0, errno = 22
strtol("0", NULL, 0) = 0, errno = 0
strtol("0", NULL, 8) = 0, errno = 0
strtol("0", NULL, 16) = 0, errno = 0
strtol("123", NULL, 10) = 123, errno = 0
strtol("20", NULL, 16) = 32, errno = 0
strtol("78", NULL, 8) = 7, errno = 0
strtol("08", NULL, 0) = 0, errno = 0
strtol("0x20", NULL, 0) = 32, errno = 0
strtol("017", NULL, 0) = 15, errno = 0
strtol("0x", NULL, 0) = 0, errno = 0
strtol("+0x20", NULL, 0) = 32, errno = 0
strtol("-0x20", NULL, 0) = -32, errno = 0
strtol("0x81111111", NULL, 16) = 2147483647, errno = 34
strtol("-0x81111111", NULL, 16) = -2147483648, errno = 34
malloc(0x8)
= 0xC0180020 [0xC0180014]
malloc(0x8)
= 0xC0180034 [0xC0180028]
malloc(0x8)
= 0xC0180048 [0xC018003C]
# getenv()
# getenv()
malloc(0x101000)
= 0xC018005C [0xC0180050]
malloc(0x800)
= 0xC0281068 [0xC028105C]
# memset(s = 0xC0281068, c = 0x0, n = 2048)
malloc(0x7d010)
= 0xC0281874 [0xC0281868]
malloc(0x2000)
= 0xC02FE890 [0xC02FE884]
malloc(0x1c)
= 0xC030089C [0xC0300890]
malloc(0x20)
= 0xC03008C4 [0xC03008B8]
# readlink()
malloc(0x20)
= 0xC03008F0 [0xC03008E4]
# getenv()
malloc(0xd)
= 0xC030091C [0xC0300910]
# strcpy(dest=0xC030091C, src=0xC016BFCC)
free(0xC03008F0): @0xC03008E4 0x20 [5]
# __sigsetjmp()
malloc(0x10038)
= 0xC0300938 [0xC030092C]
# lseek64()
# __errno_location()
malloc(0x10038)
= 0xC031097C [0xC0310970]
# lseek64()
# exception_data_abort_handler()
regs @ 0xc017bfc0
R0 = 0xffffffff R1 = 0xffffffff R2 = 0x00000019 R3 = 0x00000000
R4 = 0xc031097c R5 = 0x00000001 R6 = 0xc0065280 R7 = 0xc002256c
R8 = 0xc016bf20 R9 = 0xc006c000 R10 = 0xc0280fb0 R11 = 0xc0181000
R12 = 0xc016add0 SPu = 0xc016bee8 LRu = 0xc0008478 IPu = 0xc0021d84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants