working without OS...

Quality Quorum qqi at theworld.com
Thu Jan 10 20:40:20 UTC 2002



On Thu, 10 Jan 2002 Alexandre.Tarayre at space.alcatel.fr wrote:

>
>
> Hello,
>
> I'm working without OS and I would know how to :
>
>  - setup a periodic interrupt that calls an operation every X ms,
>  - enable interrupts,
>  - disable interrupts.
>
>
> What are the C functions (or libraries) that permit to do that ?

You do not have OS, but I suppose that you have a CPU at least. If you
have a CPU indeed, there should be a register there which controls CPU
status and in the most cases there is a bit in this register which allows
to enable and disable interrupts.

I cannot tell you what these register and bit are without knowing anything
about CPU you are using, I am sorry. However, I am sure it is possible to
find a book (usually it is called Hardware Manual) which describes all
registers of the CPU and all bits in these registers and I am sure that
you will be able to find out in this book which bit of which register is
to be flipped to disable/enable interrupts.

I am also possible to find a book which describes machine commands to be
used to access (read/write/set bit(s)/reset bit(s)) said bit in a said
register, usually it is called Software Manual.

Once you made yourself familiar with these two books, you may find out
that disabling interrupts could be achieved by C-statement as simple as
(all examples are for i386)

    asm("cli");

and enabling interrupts could be achieved by someting like

    asm("sti");


Setting up preiodic interrupts is order of magnitude more complicated and
could not be described at this level. So, you have to make yourself
familiar with enabling and disabling interrupts first, and then look
for a chapter on timers in the hardware manual, by that time you will be
well prepared to understand what does it mean.


I am afraid there is simply no other way to achive what are you looking
to do for without OS.

:):):):):)

>
>
> ALCATEL SPACE INDUSTRIES
>
>

Thanks,

Aleksey





More information about the users mailing list