Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Re: 64-bit sysinfo
@ 2003-06-12 11:19 Tor Arntsen
  2003-06-12 12:04 ` Trevor Woerner
  0 siblings, 1 reply; 10+ messages in thread
From: Tor Arntsen @ 2003-06-12 11:19 UTC (permalink / raw)
  To: mips081, linux-mips

On Jun 12, 12:05, Trevor Woerner wrote:
[...]
>I compiled a 64-bit MIPS kernel, then built a busybox-based ramdisk. At 
>first I couldn't get busybox's 'init' to work but later solved it by 
>disabling the 'check_memory()' call.
>
>Further investigation into why the 'check_memory()' call was failing 
>revealed a problem with the 'sysinfo()' system call. The kernel is 
>64-bit, therefore when it fills in the 'struct sysinfo' (as it does 
>when 'sys_meminfo()' is called) unsigned int's are 64 bits. But back in 
>userspace, the 'struct sysinfo' that gets allocated thinks that 
>unsigned int's are 32 bits.
[...]

Hm, that sounds wrong to me. 'int' is supposed to be 32 bits also on
64-bit systems, only 'long' should be 64 bits.

-Tor

^ permalink raw reply	[flat|nested] 10+ messages in thread
* 64-bit sysinfo
@ 2003-06-12 10:59 Trevor Woerner
  2003-06-12 11:35 ` Ralf Baechle
  2003-06-12 21:36 ` Andrew Clausen
  0 siblings, 2 replies; 10+ messages in thread
From: Trevor Woerner @ 2003-06-12 10:59 UTC (permalink / raw)
  To: linux-mips

Hi everyone,

(good to see some familiar and friendly faces from the PPC list! :-)

I ran into a problem yesterday and I just don't know how I'm going to 
approach solving it.

I compiled a 64-bit MIPS kernel, then built a busybox-based ramdisk. At 
first I couldn't get busybox's 'init' to work but later solved it by 
disabling the 'check_memory()' call.

Further investigation into why the 'check_memory()' call was failing 
revealed a problem with the 'sysinfo()' system call. The kernel is 
64-bit, therefore when it fills in the 'struct sysinfo' (as it does 
when 'sys_meminfo()' is called) unsigned int's are 64 bits. But back in 
userspace, the 'struct sysinfo' that gets allocated thinks that 
unsigned int's are 32 bits.

This causes a crash if the 'struct sysinfo' is allocated on the stack 
back in userspace, and causes seg faults if it's allocated in the .data 
section (globally).

I'm crossing my fingers and hoping that my solution is to build all 
user-space apps with some switch that will set the sizes of data types 
to be the same between user space and kernel space. Does some such 
option exist?

	Trevor

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-06-12 12:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-12 11:19 64-bit sysinfo Tor Arntsen
2003-06-12 12:04 ` Trevor Woerner
2003-06-12 12:04   ` Trevor Woerner
  -- strict thread matches above, loose matches on Subject: below --
2003-06-12 10:59 Trevor Woerner
2003-06-12 11:35 ` Ralf Baechle
2003-06-12 12:07   ` Trevor Woerner
2003-06-12 12:27     ` Ralf Baechle
2003-06-12 21:36 ` Andrew Clausen
2003-06-12 11:44   ` Ralf Baechle
2003-06-12 12:02     ` Trevor Woerner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox