summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-09-24 13:55:18 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-09-24 13:55:18 +0000
commit32f3e34d4d275c4a0ec45e4ee164eeb82cde520f (patch)
treeb72a8dec025416839f7ca1bf30beb6dcfb1fc685 /c/src/lib/libbsp/i386
parentNew version from Erik Ivanenko <erik.ivanenko@utoronto.ca>. (diff)
downloadrtems-32f3e34d4d275c4a0ec45e4ee164eeb82cde520f.tar.bz2
Patch from Erik Ivanenko <erik.ivanenko@utoronto.ca>:
Please find attached a start.s that includes a cli prior to the hlt instruction. This ensures that external interrupts cannot restart the system after returning to the startup code. ( According to the hlt docs, they will! ) Also find a new timer.c. ( I forgot to update the countdowm value in the timer when I changed the PSCLK frequency in start.s) . This improves timer accuracy. The raw_idt_notify messages are no longer infinite, I tested sp11 and sp05, both which were bad, and I have seen the message print once in one test. I think it's ok if it prints out once. In fact, I don't think you can effectively stop it!
Diffstat (limited to 'c/src/lib/libbsp/i386')
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/start.s34
-rw-r--r--c/src/lib/libbsp/i386/i386ex/timer/timer.c6
2 files changed, 7 insertions, 33 deletions
diff --git a/c/src/lib/libbsp/i386/i386ex/start/start.s b/c/src/lib/libbsp/i386/i386ex/start/start.s
index e8cbc71b9c..55fcb1ae82 100644
--- a/c/src/lib/libbsp/i386/i386ex/start/start.s
+++ b/c/src/lib/libbsp/i386/i386ex/start/start.s
@@ -65,7 +65,6 @@ SYM(Interrupt_descriptor_table): /* Now in data section */
END_DATA
BEGIN_DATA
-/* .section .gdt */
PUBLIC (_Global_descriptor_table)
SYM(GDTR): DESC3( GDT_TABLE, 0x1f ); # one less than the size
@@ -344,20 +343,6 @@ SYM(SetUCS1):
* The GDT must be in RAM since it must be writeable,
* So, move the whole data section down.
********************************************************/
-
-/* SYM(xfer_gdt):
- movw $ _ram_gdt_offset , di
- movw $ _ram_gdt_segment , cx
- mov cx , es
-
- movw $ _gdt_size , cx
- movw $ _rom_gdt_segment , ax
- movw $ _rom_gdt_offset , si
- mov ax , ds
-
- repne
- movsb
-*/
movw $ _ram_data_offset , di
movw $ _ram_data_segment, cx
@@ -376,14 +361,10 @@ SYM(SetUCS1):
* Table Register
****************************/
-/* movw $ _ram_gdt_segment, ax */
-
#ifdef NEXT_GAS
data32
addr32
#endif
-/* lgdt _ram_gdt_offset # location of GDT */
-
lgdt SYM(GDTR) # location of GDT
@@ -405,13 +386,11 @@ SYM(SetUCS):
* and load CS selector
*********************/
-/* ljmpl $ GDT_CODE_PTR , $ SYM(_copy_data) # sets the code selector*/
ljmpl $ GDT_CODE_PTR , $ SYM(_load_segment_registers) # sets the code selector
/*
- * Copy the data section down to RAM
+ * Load the segment registers
*/
-/*SYM(_copy_data): */
SYM(_load_segment_registers):
.code32
pLOAD_SEGMENT( GDT_DATA_PTR, fs)
@@ -420,12 +399,6 @@ SYM(_load_segment_registers):
pLOAD_SEGMENT( GDT_DATA_PTR, ds)
pLOAD_SEGMENT( GDT_DATA_PTR, es)
-/* movl $ SYM(_data_start) , edi # ram destination
- movl $ SYM(_rom_data_start) , esi # rom data source
- movl $ SYM(_data_size) , ecx # amount to move
- repne # while ecx != 0
- movsb # move a byte
-*/
/*
* Set up the stack
*/
@@ -459,8 +432,9 @@ SYM (zero_bss):
pushl $0 # argc
call SYM(boot_card)
addl $12,esp
-
- hlt
+
+ cli # stops interrupts from being processed after hlt!
+ hlt # shutdown
END
diff --git a/c/src/lib/libbsp/i386/i386ex/timer/timer.c b/c/src/lib/libbsp/i386/i386ex/timer/timer.c
index 4c29d6c57f..954bd7f6dd 100644
--- a/c/src/lib/libbsp/i386/i386ex/timer/timer.c
+++ b/c/src/lib/libbsp/i386/i386ex/timer/timer.c
@@ -47,7 +47,7 @@ void TimerOn(const rtems_raw_irq_connect_data* used)
Ttimer_val = 0; /* clear timer ISR count */
outport_byte ( TMRCON , 0xb0 ); /* select tmr2, stay in mode 0 */
- outport_byte ( TMR1 , 0xd2 ); /* set to 250 usec interval */
+ outport_byte ( TMR1 , 0xfa ); /* set to 250 usec interval */
outport_byte ( TMR1 , 0x00 );
outport_byte ( TMRCON , 0x64 ); /* change to mode 2 ( starts timer ) */
/* interrupts ARE enabled */
@@ -78,7 +78,7 @@ static rtems_raw_irq_connect_data timer_raw_irq_data = {
void Timer_exit()
{
if (!i386_delete_idt_entry(&timer_raw_irq_data)) {
- printk("Timer raw handler deconnexion failed\n");
+ printk("Timer_exit:Timer raw handler removal failed\n");
rtems_fatal_error_occurred(1);
}
}
@@ -94,7 +94,7 @@ void Timer_initialize()
atexit(Timer_exit); /* Try not to hose the system at exit. */
if (!i386_set_idt_entry (&timer_raw_irq_data)) {
- printk("raw handler connexion failed\n");
+ printk("Timer_initialize: raw handler installation failed\n");
rtems_fatal_error_occurred(1);
}
}