Re: you can't bash Microsoft enough



On 2 May 2007 19:35:35 -0700, MooseFET <kensmith@xxxxxxxxx> wrote:

On May 2, 5:42 pm, John Larkin
<jjlar...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On 2 May 2007 15:11:11 -0700, MooseFET <kensm...@xxxxxxxxx> wrote:



On May 2, 8:18 am, John Larkin
<jjlar...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On Wed, 02 May 2007 09:31:56 +0100, Paul Burke <p...@xxxxxxxxxx>
wrote:

jasen wrote:

linux in less than 256 kilobytes ???
====

was that ever possible?

Sorry, meg of course. Still harking back to the days of OS9 with 64kb
RAM....

My embedded products use a cpu with 2K bytes of on-chip ram. I've
rarely needed more, even on products with user interfaces and eternet.

2K bytes, Luxury! I did a multitasking[1] OS in 256 bytes.

[1] 3 is multiple, isn't it.

That ain't a lot of room to save even three contexts on three stacks.

Which CPU?

It was 8052. The fact that the registers are 8 memory locations and
the PSW selected which 8 made pushes for them not needed. There are 4
banks but we had to have one free.


I did a preemptive RTOS for the 6800 (the 8 bit one) with unlimited
tasks. Each task had its own stack, and the 6800 automatically pushed
all the regs onto the current stack on a hardware interrupt or an SWI.
So task context was mostly saved for free... all you had to do was
stash the stack pointer itself into the task header, and it was all
wrapped up... then run the scheduler to see who was up next.

Everybody should write one of these things once. But lately, I find
that a couple of simple state machines is all most embedded systems
really need.

John

.



Relevant Pages

  • Re: you cant bash Microsoft enough
    ... On May 2, 10:24 pm, John Larkin ... even on products with user interfaces and eternet. ... all the regs onto the current stack on a hardware interrupt or an SWI. ...
    (sci.electronics.design)
  • [PATCH for review] [108/145] x86_64: Some preparationary cleanup for stack trace
    ... - * If all_contexts is set, all contexts (hardirq, softirq and process) ... unsigned long stack, unsigned long stack_end) ...
    (Linux-Kernel)
  • Re: What Kind of DataStructures C using? ( Heap or Tree ??)
    ... if you define "stack" as any data structure accessed in LIFO ... contiguous area with LIFO access in various contexts, ... extension whereby they could be used in non-LIFO order (by adding ...
    (comp.lang.c)
  • Re: Device Driver Etiquette
    ... I maintain a device driver that has been bitten by the transition to 4K ... It used the stack for a number of large data ... sleep-capable work from interrupts-disabled contexts to user ... so if you're stack-heavy and suffer a concurrent interrupt (which ...
    (Linux-Kernel)