Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/arch.S
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/archmach.c
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machpc.c
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machpc.h
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxbox.h
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.h
Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c
Modified: branches/xen/reactos/boot/freeldr/freeldr/freeldr.c
Modified: branches/xen/reactos/boot/freeldr/freeldr/include/machine.h
Property changes on: branches/xen/reactos/boot/freeldr/freeldr
___________________________________________________________________
Name: lastmerge
- 14698
+ 14725
--- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/arch.S 2005-04-21 09:29:02 UTC (rev 14725)
+++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/arch.S 2005-04-21 09:33:23 UTC (rev 14726)
@@ -275,9 +275,11 @@
* other boot loaders like Grub
*/
+#define MB_INFO_SIZE 90
#define MB_INFO_FLAGS_OFFSET 0
#define MB_INFO_BOOT_DEVICE_OFFSET 12
#define MB_INFO_COMMAND_LINE_OFFSET 16
+#define CMDLINE_SIZE 256
/*
* We want to execute at 0x8000 (to be compatible with bootsector
@@ -285,7 +287,6 @@
* above 1MB. So we let Grub load us there and then relocate
* ourself to 0x8000
*/
-#define CMDLINE_BASE 0x7000
#define FREELDR_BASE 0x8000
#define INITIAL_BASE 0x200000
@@ -330,6 +331,31 @@
movw %dx,%ds
movw %dx,%es
+ /* Check for valid multiboot signature */
+ cmpl $MULTIBOOT_BOOTLOADER_MAGIC,%eax
+ jne mbfail
+
+ /* Store multiboot info in a safe place */
+ movl %ebx,%esi
+ movl $(mb_info + INITIAL_BASE - FREELDR_BASE),%edi
+ movl $MB_INFO_SIZE,%ecx
+ rep movsb
+
+ /* Save commandline */
+ movl MB_INFO_FLAGS_OFFSET(%ebx),%edx
+ testl $MB_INFO_FLAG_COMMAND_LINE,MB_INFO_FLAGS_OFFSET(%ebx)
+ jz mb3
+ movl MB_INFO_COMMAND_LINE_OFFSET(%ebx),%esi
+ movl $(cmdline + INITIAL_BASE - FREELDR_BASE),%edi
+ movl $CMDLINE_SIZE,%ecx
+mb2: lodsb
+ stosb
+ testb %al,%al
+ jz mb3
+ dec %ecx
+ jnz mb2
+mb3:
+
/* Copy to low mem */
movl $INITIAL_BASE,%esi
movl $FREELDR_BASE,%edi
@@ -346,8 +372,8 @@
/* Clear prefetch queue & correct CS,
* jump to low mem */
- ljmp $PMODE_CS, $mb2
-mb2:
+ ljmp $PMODE_CS, $mb4
+mb4:
/* Reload segment selectors */
movw $PMODE_DS,%dx
movw %dx,%ds
@@ -357,39 +383,28 @@
movw %dx,%ss
movl $STACK32ADDR,%esp
- /* Check for valid multiboot signature */
- cmpl $MULTIBOOT_BOOTLOADER_MAGIC,%eax
- jne mbfail
-
+ movl $mb_info,%ebx
/* See if the boot device was passed in */
movl MB_INFO_FLAGS_OFFSET(%ebx),%edx
testl $MB_INFO_FLAG_BOOT_DEVICE,%edx
- jz mb3
+ jz mb5
/* Retrieve boot device info */
movl MB_INFO_BOOT_DEVICE_OFFSET(%ebx),%eax
shrl $16,%eax
incb %al
movb %al,i386BootPartition
movb %ah,i386BootDrive
- jmp mb4
-mb3: /* No boot device known, assume first partition of first harddisk */
+ jmp mb6
+mb5: /* No boot device known, assume first partition of first harddisk */
movb $0x80,i386BootDrive
movb $1,i386BootPartition
-mb4:
-
- /* Check for a command line */
+mb6:
+ /* Check for command line */
+ mov $cmdline,%eax
+ testl $MB_INFO_FLAG_COMMAND_LINE,MB_INFO_FLAGS_OFFSET(%ebx)
+ jnz mb7
xorl %eax,%eax
- testl $MB_INFO_FLAG_COMMAND_LINE,%edx
- jz mb6
- /* Copy command line to low mem*/
- movl MB_INFO_COMMAND_LINE_OFFSET(%ebx),%esi
- movl $CMDLINE_BASE,%edi
-mb5: lodsb
- stosb
- testb %al,%al
- jnz mb5
- movl $CMDLINE_BASE,%eax
-mb6:
+mb7:
/* GO! */
pushl %eax
@@ -471,3 +486,10 @@
EXTERN(i386BootPartition)
.long 0
+
+.bss
+mb_info:
+ .fill MB_INFO_SIZE, 1, 0
+
+cmdline:
+ .fill CMDLINE_SIZE, 1, 0
--- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/archmach.c 2005-04-21 09:29:02 UTC (rev 14725)
+++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/archmach.c 2005-04-21 09:33:23 UTC (rev 14726)
@@ -28,7 +28,7 @@
#include "rtl.h"
VOID
-MachInit(VOID)
+MachInit(char *CmdLine)
{
ULONG PciId;
@@ -37,7 +37,7 @@
/* First check if we were launched by Xen */
if (XenActive)
{
- XenMachInit();
+ XenMachInit(CmdLine);
}
else
{
@@ -47,11 +47,11 @@
PciId = READ_PORT_ULONG((ULONG*) 0xcfc);
if (0x02a510de == PciId)
{
- XboxMachInit();
+ XboxMachInit(CmdLine);
}
else
{
- PcMachInit();
+ PcMachInit(CmdLine);
}
}
--- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machpc.c 2005-04-21 09:29:02 UTC (rev 14725)
+++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machpc.c 2005-04-21 09:33:23 UTC (rev 14726)
@@ -25,7 +25,7 @@
#include "i386.h"
VOID
-PcMachInit(VOID)
+PcMachInit(char *CmdLine)
{
EnableA20();
--- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machpc.h 2005-04-21 09:29:02 UTC (rev 14725)
+++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machpc.h 2005-04-21 09:33:23 UTC (rev 14726)
@@ -26,7 +26,7 @@
#include "mm.h"
#endif
-VOID PcMachInit(VOID);
+VOID PcMachInit(char *CmdLine);
VOID PcConsPutChar(int Ch);
BOOL PcConsKbHit();
--- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c 2005-04-21 09:29:02 UTC (rev 14725)
+++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c 2005-04-21 09:33:23 UTC (rev 14726)
@@ -23,7 +23,7 @@
#include "i386.h"
VOID
-XboxMachInit(VOID)
+XboxMachInit(char *CmdLine)
{
/* Initialize our stuff */
XboxMemInit();
--- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxbox.h 2005-04-21 09:29:02 UTC (rev 14725)
+++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxbox.h 2005-04-21 09:33:23 UTC (rev 14726)
@@ -26,7 +26,7 @@
UCHAR XboxFont8x16[256 * 16];
-VOID XboxMachInit(VOID);
+VOID XboxMachInit(char *CmdLine);
VOID XboxConsPutChar(int Ch);
BOOL XboxConsKbHit();
--- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c 2005-04-21 09:29:02 UTC (rev 14725)
+++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c 2005-04-21 09:33:23 UTC (rev 14726)
@@ -90,7 +90,7 @@
}
VOID
-XenMachInit(VOID)
+XenMachInit(char *CmdLine)
{
/* Setup vtbl */
MachVtbl.ConsPutChar = XenConsPutChar;
@@ -185,7 +185,7 @@
/* Start freeldr */
XenActive = TRUE;
i386BootDrive = 0x80;
- i386BootPartition = 0xff;
+// i386BootPartition = 0xff;
BootMain(XenStartInfo->cmd_line);
/* Shouldn't get here */
--- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.h 2005-04-21 09:29:02 UTC (rev 14725)
+++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.h 2005-04-21 09:33:23 UTC (rev 14726)
@@ -34,7 +34,7 @@
extern start_info_t *XenStartInfo;
extern shared_info_t *XenSharedInfo;
-VOID XenMachInit(VOID);
+VOID XenMachInit(char *CmdLine);
VOID XenCtrlIfInit();
BOOL XenCtrlIfSendMessageNoblock(ctrl_msg_t *Msg);
--- branches/xen/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c 2005-04-21 09:29:02 UTC (rev 14725)
+++ branches/xen/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c 2005-04-21 09:33:23 UTC (rev 14726)
@@ -279,7 +279,7 @@
BootMain("freeldr-ppc");
}
-void MachInit() {
+void MachInit(char *CmdLine) {
int len;
printf( "Determining boot device:\n" );
len = ofw_getprop(chosen_package, "bootpath",
--- branches/xen/reactos/boot/freeldr/freeldr/freeldr.c 2005-04-21 09:29:02 UTC (rev 14725)
+++ branches/xen/reactos/boot/freeldr/freeldr/freeldr.c 2005-04-21 09:33:23 UTC (rev 14726)
@@ -31,7 +31,7 @@
{
CmdLineParse(CmdLine);
- MachInit();
+ MachInit(CmdLine);
DebugInit();
--- branches/xen/reactos/boot/freeldr/freeldr/include/machine.h 2005-04-21 09:29:02 UTC (rev 14725)
+++ branches/xen/reactos/boot/freeldr/freeldr/include/machine.h 2005-04-21 09:33:23 UTC (rev 14726)
@@ -73,7 +73,7 @@
VOID (*Die)(VOID);
} MACHVTBL, *PMACHVTBL;
-VOID MachInit(VOID);
+VOID MachInit(char *CmdLine);
extern MACHVTBL MachVtbl;