This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
i386 HAL, stack segment not initialised
- To: eCos List <ecos-discuss at sources dot redhat dot com>
- Subject: [ECOS] i386 HAL, stack segment not initialised
- From: Ian Campbell <icampbell at arcom dot co dot uk>
- Date: 28 Sep 2001 10:52:28 +0100
It may be something that I have changed (I don't think so though), but
when booting RedBoot from ROM and then loading an application via GDB it
seems that %ss never gets initialised, this causes a crash on the first
context switch or when changing %esp (at least on the 386ex it does).
The attached patch initialises ss in hal_cpu_init along with the other
data segment registers. I'm not sure this is the correct general
solution, but 'it works for me(tm)'. The patch also contains a rather
pedantic change to make the names used for some registers match the
suffix on the opcode.
Regards,
Ian.
--
Ian Campbell
Design Engineer
Arcom Control Systems Ltd,
Clifton Road,
Cambridge CB1 7EA
United Kingdom
Tel: +44 (0)1223 411200 ext. 3204
E-Mail: icampbell@arcom.co.uk
Web: http://www.arcomcontrols.com
_____________________________________________________________________
The message in this transmission is sent in confidence for the attention of the addressee only and should not be disclosed to any other party. Unauthorised recipients are requested to preserve this confidentiality. Please advise the sender if the addressee is not resident at the receiving end.
This message has been checked for all viruses by MessageLabs Virus Control Centre.
Company registered in England No. 1608562.
Registered Office: Unit 8, Clifton Road, Cambridge, CB1 7EA, United Kingdom, Tel: 01223 411200.
--- platform.inc.orig Fri Sep 28 10:19:13 2001
+++ platform.inc Fri Sep 28 10:20:05 2001
@@ -76,8 +76,8 @@
lgdt 0
# Make an IDT pointer in location 0 and load new LDTR
- movw $0x77F,%eax
- movw %eax,0
+ movw $0x77F,%ax
+ movw %ax,0
leal idtStart,%eax
movl %eax,2
lidt 0
@@ -140,6 +140,8 @@
movw %ax, %fs
movw %ax, %gs
+ movw %ax, %ss
+
# Set up SP
movl $__interrupt_stack,%esp