diff options
author | iap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk> | 2003-10-06 17:18:26 +0000 |
---|---|---|
committer | iap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk> | 2003-10-06 17:18:26 +0000 |
commit | e4130630e189f44c1371dc8c78b66b8bcf6df732 (patch) | |
tree | 8502aa47aab90a0e59e3db0da53ada16f48a4213 /extras/mini-os/head.S | |
parent | cc2ec41082ca2cc7c641794b3f52c4ee8233dc5f (diff) | |
download | xen-e4130630e189f44c1371dc8c78b66b8bcf6df732.tar.gz xen-e4130630e189f44c1371dc8c78b66b8bcf6df732.tar.bz2 xen-e4130630e189f44c1371dc8c78b66b8bcf6df732.zip |
bitkeeper revision 1.483 (3f81a3e2iM-0WXaGxUS3ywM3_KZqLw)
move mini-os to extras directory
Diffstat (limited to 'extras/mini-os/head.S')
-rw-r--r-- | extras/mini-os/head.S | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/extras/mini-os/head.S b/extras/mini-os/head.S new file mode 100644 index 0000000000..3f4e6670c3 --- /dev/null +++ b/extras/mini-os/head.S @@ -0,0 +1,46 @@ +#include <os.h> + +/* Offsets in start_info structure */ +#define SHARED_INFO 4 +#define MOD_START 12 +#define MOD_LEN 16 + +#define ENTRY(X) .globl X ; X : + +.globl _start +_start: + cld + + lss stack_start,%esp + + /* Copy any module somewhere safe before it's clobbered by BSS. */ + mov MOD_LEN(%esi),%ecx + shr $2,%ecx + jz 2f /* bail from copy loop if no module */ + + mov $_end,%edi + add MOD_LEN(%esi),%edi + mov MOD_START(%esi),%eax + add MOD_LEN(%esi),%eax +1: sub $4,%eax + sub $4,%edi + mov (%eax),%ebx + mov %ebx,(%edi) + loop 1b + mov %edi,MOD_START(%esi) + + /* Clear BSS first so that there are no surprises... */ +2: xorl %eax,%eax + movl $__bss_start,%edi + movl $_end,%ecx + subl %edi,%ecx + rep stosb + + push %esi + call start_kernel + + +stack_start: + .long stack+8192, __KERNEL_DS + + |