use grub_{setjmp,longjmp} to restart stage2.

This commit is contained in:
okuji committed 2000-01-05 06:02:22 +00:00
1 parent 817ae7fd92
commit 4ca2160923
8 files changed
+138 -25

No files matched your search

+18 -7
View File
@@ -1,7 +1,7 @@
/* asmstub.c - a version of shared_src/asm.S that works under Unix */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999 Free Software Foundation, Inc.
* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,11 +26,6 @@
/* Simulator entry point. */
int grub_stage2 (void);
/* We want to prevent any circularararity in our stubs, as well as
libc name clashes. */
#define WITHOUT_LIBC_STUBS 1
#include "shared.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -67,8 +62,13 @@ int grub_stage2 (void);
# include <util.h>
#endif /* HAVE_OPENDISK */
/* We want to prevent any circularararity in our stubs, as well as
libc name clashes. */
#define WITHOUT_LIBC_STUBS 1
#include "shared.h"
/* Simulated memory sizes. */
#define EXTENDED_MEMSIZE (4 * 1024 * 1024) /* 4MB */
#define EXTENDED_MEMSIZE (3 * 1024 * 1024) /* 3MB */
#define CONVENTIONAL_MEMSIZE (640) /* 640kB */
/* Simulated disk sizes. */
@@ -751,6 +751,17 @@ gotoxy (int x, int y)
#endif
}
int
grub_setjmp (grub_jmp_buf env)
{
return setjmp (env);
}
void
grub_longjmp (grub_jmp_buf env, int val)
{
longjmp (env, val);
}
/* displays an ASCII character. IBM displays will translate some
characters to special graphical ones */
+2 -1
View File
@@ -1,7 +1,7 @@
/* main.c - experimental GRUB stage2 that runs under Unix */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999 Free Software Foundation, Inc.
* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,6 +27,7 @@ int grub_stage2 (void);
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <setjmp.h>
#define WITHOUT_LIBC_STUBS 1
#include "shared.h"