POSIX equivalent of rtems_timer_fire_after

Joel Sherrill joel.sherrill at OARcorp.com
Tue Mar 9 17:31:01 UTC 2004


Richard M. Barry wrote:
> I'm rewriting some code that uses a Classic API timer to trigger the excecution of a procedure after a certain amount of time has elapsed, by calling rtems_timer_fire_after(... , rtems_timer_service_routine ,...)
> 
> I want to rewrite the code to only use the POSIX API, so I have to implement an equivalent mechanism.   My question is, is the best way to do this:
> 
> 1.Start a POSIX thread (containg the code previously in the rtems_timer_service_routine) that waits for a signal using sigsuspend(), and then 
> 2.start a timer that fires the needed signal in my main thread?   
> 
> Just making sure I understand the use of sigsuspend() correctly.

Without building a timer server that executes an arbitrary user provided
function, I think that is the only mechanism POSIX provides.

This is one area I think POSIX was weak in.

> Thanks,
> Richard
> 



 
Return-Path: <vvv at oktetlabs.ru>
Mailing-List: contact rtems-users-help at rtems.com; run by ezmlm
Delivered-To: mailing list rtems-users at rtems.com
Received: (qmail 13142 invoked from network); 9 Mar 2004 17:32:33 -0000
Received: from unknown (HELO smtp.rol.ru) (194.67.21.9)
  by 0 with SMTP; 9 Mar 2004 17:32:33 -0000
Received: from ts1-a29.Spb.dial.rol.ru ([195.190.98.29]:30345 "EHLO
	oktetlabs.ru" smtp-auth: <none> TLS-CIPHER: <none> TLS-PEER-CN1: <none>)
	by gnome05.net.rol.ru with ESMTP id S17616188AbUCIRcc (ORCPT
	<rfc822;rtems-users at rtems.com>); Tue, 9 Mar 2004 20:32:32 +0300
Message-ID: <404DFFAD.5040000 at oktetlabs.ru>
Date:	Tue, 09 Mar 2004 20:32:29 +0300
From:	"Victor V. Vengerov" <vvv at oktetlabs.ru>
Organization: OKTET Labs.
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225
X-Accept-Language: en, ru
MIME-Version: 1.0
To:	Adriano Verardo <a.verardo at tecmav.fastwebnet.it>
CC:	rtems-users <rtems-users at rtems.com>
Subject: Re: DOSFS problems
References: <404CD3DC.15836.13FFDC at localhost> <404CF2C0.17667.8C1A6A at localhost> <404DE205.8010908 at tecmav.fastwebnet.it> <404DE41D.9030400 at oktetlabs.ru> <404DF21A.9010306 at tecmav.fastwebnet.it> <404DF8A3.9010500 at oktetlabs.ru> <404DFD6A.3080507 at tecmav.fastwebnet.it>
In-Reply-To: <404DFD6A.3080507 at tecmav.fastwebnet.it>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

What we are talking about?

MBR - master boot record - stored in very first block of hard disk.
It contains the boot code and partition table at the block end.

Fragment

0x000-0x002  Jump instruction
0x003-0x00A  8 bytes OEM String ("MSDOS 5.0", for example)
0x00B-0x00C Bios Parameters Block - BytesPerSector
                    Usually 00 20 = 512 and not 07 50 = 20.487
0x00D-...       Other BPB, Boot code etc etc.

is a layout of first block of the active hard disk partition.
Boot loader in the MBR read the partition table, find active partition
and load boot loader at the start of active partition. Boot loader
in partition continue to boot OS stored in the partition.

Boot loader of DOS partition should look like you described, i.e.
BPB - BIOS Parameter Block should be stored in the beginning.

I mean, no OEM signature, BPB and so on expected to be in the
MBR.

Or I have missed something?

Victor

Adriano Verardo wrote:

> Victor V. Vengerov wrote:
>
>> Adriano,
>>
>> As I remember, partition table is located at the end of first block.
>> Fragment you show looks like Intel boot loader code. 
>
>
> The fragment shoul be:
> 0x000-0x002  Jump instruction
> 0x003-0x00A  8 bytes OEM String ("MSDOS 5.0", for example)
> 0x00B-0x00C Bios Parameters Block - BytesPerSector
>                     Usually 00 20 = 512 and not 07 50 = 20.487
> 0x00D-...       Other BPB, Boot code etc etc.
> 0x01BE...       Partition table
> 0x1FE            Signature (55 AA)
>
>
> DOSF requires a correct (512/1024/2048) value at 0x00B/C, so breaks 
> before
> trying to access the other data ...
>
> Adriano
>


-- 
Victor V. Vengerov
OKTET Labs.
Phone: mobile +7 812 9389372, home +7 812 4281653 





More information about the users mailing list