Norma; 'boot sequence' for a CPU?

P

phil

Guest
I'm curious, please indulge me - what is the normal 'boot sequence'
for your average old CPU?

Let's take a Z80 for example - when a board with a Z80 (and relevant
RAM, ROM and support chips) is powered on, what is the sequence of
events that takes place?

Does the CPU, for example, first expect an interrupt from some other
part of the circuit? Does it immediately try and access RAM or ROM via
the address lines? Etc.

Or is there a web site somewhere with this info?

I'd really like to know this as it will help my understanding
considerably.


Thanks
Phil
 
"phil" <pdmim@hotmail.com> wrote in message
news:4181f16a.827813625@news.individual.net...
I'm curious, please indulge me - what is the normal 'boot sequence'
for your average old CPU?

Let's take a Z80 for example - when a board with a Z80 (and relevant
RAM, ROM and support chips) is powered on, what is the sequence of
events that takes place?

Does the CPU, for example, first expect an interrupt from some other
part of the circuit? Does it immediately try and access RAM or ROM via
the address lines? Etc.

Or is there a web site somewhere with this info?

I'd really like to know this as it will help my understanding
considerably.


Thanks
Phil

Its been quite a while since I messed with a Z80.

You might try your question here:comp.arch.hobbyist

Regards,

Tom
 
pdmim@hotmail.com (phil) wrote:

Let's take a Z80 for example - when a board with a Z80 (and relevant
RAM, ROM and support chips) is powered on, what is the sequence of
events that takes place?
It starts running, reading the first RAM memory address.

Does the CPU, for example, first expect an interrupt from some other
part of the circuit?
No

Does it immediately try and access RAM or ROM via
the address lines? Etc.
Yes

Or is there a web site somewhere with this info?
Probably



--
Roger J.
 
pdmim@hotmail.com (phil) wrote:

Cheers, will do. All advice welcome. :)

Googling for "z80 reference" gives some promising hits:

http://www.lawrencechitty.uklinux.net/wizardwiki/index.php?Z80%20Reference

for example.



--
Roger J.
 
On 29 Oct 2004 08:53:36 GMT, Roger Johansson wrote:

pdmim@hotmail.com (phil) wrote:

Let's take a Z80 for example - when a board with a Z80 (and relevant
RAM, ROM and support chips) is powered on, what is the sequence of
events that takes place?

It starts running,
reset sequences/modes vary from proc to proc and family 2 family,
clearing and setting initial register values and perhaps leaving
others alone or undefined.

reading the first RAM memory address.
IIRC, some of 'em had the reset vector high, no?
Does the CPU, for example, first expect an interrupt from some other
part of the circuit?

No
processors don't "expect" ints per se, but you can enable and
disable some/most, sometimes all ints by writing a control register.
Does it immediately try and access RAM or ROM via
the address lines? Etc.

Yes
Let's not forget those data/io lines.
Or is there a web site somewhere with this info?

Probably
Those spec sheet thingies? My best suggestion is for the OP to start
reading those. They're priceless and free.
--
Best Regards,
Mike
 
Active8 <reply2group@ndbbm.net> wrote:

Those spec sheet thingies? My best suggestion is for the OP to start
reading those. They're priceless and free.
The Z80 reference manual:

http://www.zilog.com/docs/z80/um0080.pdf

Inside that pdf file, look at page 28, a minimum system.

See the reset circuit connected to the -reset pin, it is only a resistor from plus 5 Volt and a capacitor to ground.
When the power supply starts the capacitor is charged, and Z80 starts.
It then starts executing the first RAM memory address.



--
Roger J.
 
On 29 Oct 2004 08:53:36 GMT, Roger Johansson <no-email@home.se> wrote:

pdmim@hotmail.com (phil) wrote:

Let's take a Z80 for example - when a board with a Z80 (and relevant
RAM, ROM and support chips) is powered on, what is the sequence of
events that takes place?

It starts running, reading the first RAM memory address.
But there's nothing in RAM yet. That would be insta-crash.

Most CPUs fetch a vector (start pointer) from a fixed location in ROM,
which then starts executing BIOS code in ROM, which will eventually
copy the OS from a disk file into RAM and jump into that.

John
 
Let's take a Z80 for example - when a board with a Z80 (and relevant
RAM, ROM and support chips) is powered on, what is the sequence of
events that takes place?

It starts running, reading the first RAM memory address.
Following a reset, the Z80 will go to address 0000 and begin to execute that
code. If its RAM, its a problem :) The EPROM will be mapped to that address.
In the early days of 8 and 16 bit CPUs, the restart address was often 0000,
but some, like Motorola start at the highest memory address. Where that
address is on the newest generation, I don't know for sure, but I would
venture a guess that the Intel family goes to 0000 and Motorola goes to the
highest address. Its hard to teach old dogs new tricks. :)

John
 
John Larkin <jjlarkin@highSNIPlandTHIStechPLEASEnology.com> wrote:

It starts running, reading the first RAM memory address.

But there's nothing in RAM yet. That would be insta-crash.

I have used static RAM as ROM myself, that is why I said RAM.
Most people would maybe call a programmed memory a PROM, even if it
actually is a battery-backed static RAM, which is a lot easier to handle
for experimental work, because there is no need for a special programmer
or eraser.

And it doesn't crash, if the first address is empty or not connected it
will just try the next address.

If I recall correctly a memory content of nothing, zero, makes the cpu
execute a NOP, a no operation operation, and it goes on to the next
address.

Even if you have no memory connected you can see the addresslines count
up, trying to find some content other than zero.

Maybe I should add that my knowledge in this field is 20 years old, and
maybe not correct in all details. It was in 1984 I was playing with a
Z80 and static RAM. And I am too lazy to check it up now. :)


--
Roger J.
 
stratus46@yahoo.com (Glenn Gundlach) wrote:

When the power supply starts the capacitor is charged, and Z80 starts.
It then starts executing the first RAM memory address.

That simply cannot be. The 'first' RAM address contains garbage data
since it was just powered up.
Not if it is a programmed static RAM, which then works just like a
ROM/PROM.

I suspect the reset vector points to a
ROM address and execution procedes from that instruction.
After reset it starts from memory location zero, and executes the
instruction it finds there. What kind of memory, in a technical sense,
you are using doesn't matter, static RAM, ROM, PROM, EPROM, hardware
switches, diode matrix, or whatever.

(You probably associated to dynamic RAM when I said RAM, but there are
other kinds of RAM memory, which can have a predictable (programmed)
content.)


--
Roger J.
 
On Fri, 29 Oct 2004 18:43:55 +0000, Jonathan Kirwan wrote:

On Fri, 29 Oct 2004 07:40:13 GMT, pdmim@hotmail.com (phil) wrote:

I'm curious, please indulge me - what is the normal 'boot sequence' for
your average old CPU?
....
What happens after that will depend on the code.

In your IBM PC, it's the BIOS flash or ROM that sits at this point and
helps to start up your PC. In many embedded systems, using small
microcontrollers, it's entirely code you write for your application,
forced to be placed at the right location by a locating linker.
A Locating Linker? Sheesh! I just wrote my code right at its target
address. My assembler would generally put out a .hex file, which I'd
send to the programmer or emulator.

Cheers!
Rich
 
On Fri, 29 Oct 2004 17:18:55 +0000, Roger Johansson wrote:

John Larkin <jjlarkin@highSNIPlandTHIStechPLEASEnology.com> wrote:

It starts running, reading the first RAM memory address.

But there's nothing in RAM yet. That would be insta-crash.


I have used static RAM as ROM myself, that is why I said RAM. Most people
would maybe call a programmed memory a PROM, even if it actually is a
battery-backed static RAM, which is a lot easier to handle for
experimental work, because there is no need for a special programmer or
eraser.

And it doesn't crash, if the first address is empty or not connected it
will just try the next address.
As long as what it's getting is a NOP.
If I recall correctly a memory content of nothing, zero, makes the cpu
execute a NOP, a no operation operation, and it goes on to the next
address.
In 8086, 00H is MOV AX,WORD PTR{BX}. NOP is 90H. :)

Cheers!
Rich
 
Rich Grise <rich@example.net> wrote:

If I recall correctly a memory content of nothing, zero, makes the cpu
execute a NOP, a no operation operation, and it goes on to the next
address.

In 8086, 00H is MOV AX,WORD PTR{BX}. NOP is 90H. :)

That is one of the reasons why I prefer Zilog :)



--
Roger J.
 
On Fri, 29 Oct 2004 22:44:48 GMT, Rich Grise <rich@example.net> wrote:

On Fri, 29 Oct 2004 18:43:55 +0000, Jonathan Kirwan wrote:

On Fri, 29 Oct 2004 07:40:13 GMT, pdmim@hotmail.com (phil) wrote:

I'm curious, please indulge me - what is the normal 'boot sequence' for
your average old CPU?
...
What happens after that will depend on the code.

In your IBM PC, it's the BIOS flash or ROM that sits at this point and
helps to start up your PC. In many embedded systems, using small
microcontrollers, it's entirely code you write for your application,
forced to be placed at the right location by a locating linker.

A Locating Linker? Sheesh! I just wrote my code right at its target
address. My assembler would generally put out a .hex file, which I'd
send to the programmer or emulator.
Some assemblers do that. Particularly, if they are used in cases where they do
NOT support multiple source code files per project. Most systems that support
multiple source code files and separate compilation/assembly use a locating
linker, even if you don't see it operating (which you often don't, unless you
know what to look for.)

Jon
 
stratus46@yahoo.com (Glenn Gundlach) wrote:

You say that 'static RAM' would be OK and that is just
not the case. Static RAM is only static as long as the power is on.
Obviously a battery backed static RAM (non volatile RAM) could work.
From a powered off condition, the RAM contents is random garbage and
is useless as code.
If you read the latest messages in the newsgroup before you post you
can save yourself, and others, a lot of unnecessary work.
Somebody may have already answered your question already.


--
Roger J.
 
I'm curious, please indulge me - what is the normal 'boot sequence' for
your average old CPU?
===========================
Your use of the word 'boot' seems to imply
loading an operating system.... this would be CPM during the Z80 years... late
70s early 80s...You have 64K of ram, but 8K or so is a rom with perhaps some
minimal 'monitor' functionality. The 'boot block' on the floppy was the first
sector... The boot sequence for msdos was taken from cpm... read the boot block
into ram, jump to it. The boot block has a little more smarts and can read the
track and sector containing the op sys into memory, and jump to that. Once the
op sys is running, I guess thats when the prompt shows up.
 
stratus46@yahoo.com (Glenn Gundlach) wrote:

You say that 'static RAM' would be OK and that is just
not the case. Static RAM is only static as long as the power is on.
Obviously a battery backed static RAM (non volatile RAM) could work.
From a powered off condition, the RAM contents is random garbage and
is useless as code.

If you read the latest messages in the newsgroup before you post you
can save yourself, and others, a lot of unnecessary work.
Somebody may have already answered your question already.

Sir, I didn't HAVE a question. I was respoding to your assertion that
the processor began running from RAM at address zero.

You questioned that static RAM could be OK.
(see the quote from you at the top of this message)

I had already explained that I was talking about battery-backed static
RAM when you posted that message.

When it comes to the other issue, if cpu:s start at memory address zero
or not:

Most of them do. It is by far the most common start address.


--
Roger J.
 
On Fri, 29 Oct 2004 11:04:05 -0600, uvcceet@juno.com wrote:

Let's take a Z80 for example - when a board with a Z80 (and relevant
RAM, ROM and support chips) is powered on, what is the sequence of
events that takes place?

It starts running, reading the first RAM memory address.


Following a reset, the Z80 will go to address 0000 and begin to execute that
code. If its RAM, its a problem :) The EPROM will be mapped to that address.
In the early days of 8 and 16 bit CPUs, the restart address was often 0000,
but some, like Motorola start at the highest memory address. Where that
address is on the newest generation, I don't know for sure, but I would
venture a guess that the Intel family goes to 0000 and Motorola goes to the
highest address. Its hard to teach old dogs new tricks. :)

John
IIRC the 68000 family was the first mot uP to start at addy 00 -
ISTR the 6800s starting high.
--
Best Regards,
Mike
 
On Fri, 29 Oct 2004 18:44:02 -0700, Jamie wrote:

<snip>
Most CPUs fetch a vector (start pointer) from a fixed location in ROM,
which then starts executing BIOS code in ROM, which will eventually
copy the OS from a disk file into RAM and jump into that.

John

if memory serves, the 0700:0000 rings a bell.
or something like that as to where the
boot loader gets it code loaded into form the
boot sector.
for PCs its 0xAA55 or 0x55AA - i forgetted ;)
--
Best Regards,
Mike
 
On Fri, 29 Oct 2004 22:44:48 GMT, Rich Grise wrote:

On Fri, 29 Oct 2004 18:43:55 +0000, Jonathan Kirwan wrote:

On Fri, 29 Oct 2004 07:40:13 GMT, pdmim@hotmail.com (phil) wrote:

I'm curious, please indulge me - what is the normal 'boot sequence' for
your average old CPU?
...
What happens after that will depend on the code.

In your IBM PC, it's the BIOS flash or ROM that sits at this point and
helps to start up your PC. In many embedded systems, using small
microcontrollers, it's entirely code you write for your application,
forced to be placed at the right location by a locating linker.


A Locating Linker? Sheesh! I just wrote my code right at its target
address. My assembler would generally put out a .hex file, which I'd
send to the programmer or emulator.

That's pretty passe` IMO. I've never heard of "locating" linker -
linker/loader, yes. I write my embedded code to be relocatable, but
I can specify where certain blocks go in the linker script, for
e.g., the reset & ISR vector must be placed just so and sometimes
I'll force data registers to be on a specific page so I don't have
to force page switches to access data within a routine when all the
data should all be in the same page.

ORG - never use it anymore.
RORG - the original (?) relocation linker directive.

You can still write PC code in asm. - exe files have a special
header starting at 0x00, .com programs are ORG 0x100, and .sys files
are ORG 0x00. The rest of the code can be roelocatable.

--
Best Regards,
Mike
 

Welcome to EDABoard.com

Sponsor

Back
Top