ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: Help me to write a C code for read temperarutere on TS

To:
Subject: Re: [ts-7000] Re: Help me to write a C code for read temperarutere on TS-7200 (NetBSD 3.1)
From: Andres Gomez <>
Date: Sat, 8 Nov 2008 19:28:39 -0800 (PST)
Thanks for your tips. Finally, I can run the program tempSensor on NetBSD. The problem is that I can only run in single-user mode. I tried to set the securelevel to 0, but when at the final moment to switch to multiuser-mode change it to 1 and I can not change it again. I have managed to "hack" this by changing the last line of /etc/rc file, where it says "exit 0" to "exit 1", for run a tempsensor as daemon (a program in foreground with an infinite loop while you record the temperature in a file, for example: /tmp/temp.tmp), but this is not very elegant and also lose features such as: login, and so on.
How can I change the securelevel to 0 when the kernel was compiled without this option? Or how can access to /dev/mem with securelevel in 1? The parameter kern.mapped_files is set to 1. I need some form of access to the mapping of memory, any idea how to do it please?



--- El sÃb 8-nov-08, charliem_1216 <> escribiÃ:
De: charliem_1216 <>
Asunto: [ts-7000] Re: Help me to write a C code for read temperarutere on TS-7200 (NetBSD 3.1)
Para:
Fecha: sÃbado, 8 de noviembre de 2008, 4:15 am

--- In .com, Andres Gomez <andres.gomez08@ ...>
wrote:
>
> yes, Charlie, this is the point, but when I try to set securelevel
in -1 or 0 it shows this message:
> # sysctl -w kern.securelevel= -1
> sysctl: kern.securelevel: sysctl() failed with Operation not
permitted

Yes, I understand that only the init process can *reduce*
securelevel

> At moment, my securelevel is 1, I read that I init from
single-user mode the securelevel is 0...I'll try to run my temp
sensor script (which write /dev/mem). The kernel compiled in the
official NetBSD FTP for 3.1 release has compiled with OPTION
INSECURE (without adding `option INSECURE' in the kernel
configuration file) and I don't know how to decrease this level
to -1 or 0.

Single user mode should be 0 as you said, so you can at least test
the usermode linux-style program there.

Being curious, I just downloaded netBSD 3.1.1 (i386), and brought it
up. By default, my securelevel is -1 already in multiuser mode.
Sounds like ARM is different. You can add "securelevel= -1"
to /etc/rc.config, if you want to boot that way and the kernel
allows it. You may have to rebuild the kernel to allow it though.

Also, look at the kernel.mapped_ files sysctl value. It will tell
you if your system offers memory mapped files. My i386 test system
shows kernel.mapped_ files=1; ARM should be the same.

>
> Other options perphaps is call to my script on /etc/rc file at
start process before change de securelevel from 0 to 1.

Maybe, but that would just tell you the temperature one time, at
boot.

Regards, ......... Charlie

> What do you say Charlie?
> &#65533;
>
> --- El jue 6-nov-08, charliem_1216 <charliem_1216@ ...> escribiÃÂ:
> De: charliem_1216 <charliem_1216@ ...>
> Asunto: [ts-7000] Re: Help me to write a C code for read
temperarutere on TS-7200 (NetBSD 3.1)
> Para: .com
> Fecha: jueves, 6 de noviembre de 2008, 5:26 pm
>
>
>
>
>
>
>
>
>
>
>
> --- In .com, Andres Gomez
<andres.gomez08@ ....> wrote:
>
> >
>
> > It isn't so simple, Charlie. The Linux code tempSensor.c don't
run
>
> on NetBSD, I tried it. I reed the Datasheet
>
>
>
> Andres,
>
>
>
> What is the error when you run the linux tempSensor code? Have
you
>
> traced it?
>
>
>
> Note that to be able to open /dev/mem you probably must change the
>
> netBSD secure level, as described here:
>
> http://wiki. netbsd.se/ Kernel_secure_ levels
>
>
>
> Once you can open /dev/mem and mmap it as needed, I don't see why
the
>
> linux userspace approach won't work.
>
>
>
> Regards, ......... Charlie
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
____________ _________ _________ _________ _________ _________ _
> ÃÂBuscÃÂ desde tu celular!
>
> Yahoo! oneSEARCH ahora estÃÂ en Claro
>
> http://ar.mobile. yahoo.com/ onesearch
>




ÂBuscà desde tu celular! Yahoo! oneSEARCH ahora està en Claro
http://ar.mobile.yahoo.com/onesearch
__._,_.___

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU