Renamed devices_check_boot_cd() to check_boot_cd() and moved it up to the other BIOS
functions - it no longer terminates the CD-ROM emulation, but only checks the status, and therefore, it's now called by platform_register_boot_device() instead of from platform_start_kernel(). This also makes the devices.h header useless. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14390 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
51e081bade
commit
2e2bd87511
@ -4,7 +4,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "devices.h"
|
|
||||||
#include "bios.h"
|
#include "bios.h"
|
||||||
|
|
||||||
#include <boot/platform.h>
|
#include <boot/platform.h>
|
||||||
@ -33,6 +32,7 @@ extern uint32 gBootPartitionOffset;
|
|||||||
#define BIOS_IS_EXT_PRESENT 0x4100
|
#define BIOS_IS_EXT_PRESENT 0x4100
|
||||||
#define BIOS_EXT_READ 0x4200
|
#define BIOS_EXT_READ 0x4200
|
||||||
#define BIOS_GET_EXT_DRIVE_PARAMETERS 0x4800
|
#define BIOS_GET_EXT_DRIVE_PARAMETERS 0x4800
|
||||||
|
#define BIOS_BOOT_CD_GET_STATUS 0x4b01
|
||||||
|
|
||||||
struct real_addr {
|
struct real_addr {
|
||||||
uint16 offset;
|
uint16 offset;
|
||||||
@ -152,6 +152,42 @@ class BIOSDrive : public Node {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
check_cd_boot(void)
|
||||||
|
{
|
||||||
|
gKernelArgs.boot_disk.cd = false;
|
||||||
|
|
||||||
|
if (gBootDriveID != 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
struct bios_regs regs;
|
||||||
|
regs.eax = BIOS_BOOT_CD_GET_STATUS;
|
||||||
|
regs.edx = 0;
|
||||||
|
regs.esi = kDataSegmentScratch;
|
||||||
|
call_bios(0x13, ®s);
|
||||||
|
|
||||||
|
if ((regs.flags & CARRY_FLAG) != 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// we obviously were booted from CD!
|
||||||
|
|
||||||
|
specification_packet *packet = (specification_packet *)kDataSegmentScratch;
|
||||||
|
|
||||||
|
if (packet->media_type != 0)
|
||||||
|
gKernelArgs.boot_disk.cd = false;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
dprintf("got CD boot spec:\n");
|
||||||
|
dprintf(" size: %#x\n", packet->size);
|
||||||
|
dprintf(" media type: %u\n", packet->media_type);
|
||||||
|
dprintf(" drive_number: %u\n", packet->drive_number);
|
||||||
|
dprintf(" controller index: %u\n", packet->controller_index);
|
||||||
|
dprintf(" start emulation: %lu\n", packet->start_emulation);
|
||||||
|
dprintf(" device_specification: %u\n", packet->device_specification);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
get_ext_drive_parameters(uint8 drive, drive_parameters *targetParameters)
|
get_ext_drive_parameters(uint8 drive, drive_parameters *targetParameters)
|
||||||
{
|
{
|
||||||
@ -490,45 +526,6 @@ BIOSDrive::Size() const
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
extern "C" void
|
|
||||||
devices_check_cd_boot(void)
|
|
||||||
{
|
|
||||||
gKernelArgs.boot_disk.cd = false;
|
|
||||||
|
|
||||||
if (gBootDriveID != 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
struct bios_regs regs;
|
|
||||||
regs.eax = 0x4b00;
|
|
||||||
regs.edx = 0;
|
|
||||||
regs.esi = kDataSegmentScratch;
|
|
||||||
call_bios(0x13, ®s);
|
|
||||||
|
|
||||||
if ((regs.flags & CARRY_FLAG) != 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// we obviously were booted from CD!
|
|
||||||
|
|
||||||
specification_packet *packet = (specification_packet *)kDataSegmentScratch;
|
|
||||||
|
|
||||||
if (packet->media_type != 0)
|
|
||||||
gKernelArgs.boot_disk.cd = false;
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
dprintf("got CD boot spec:\n");
|
|
||||||
dprintf(" size: %#x\n", packet->size);
|
|
||||||
dprintf(" media type: %u\n", packet->media_type);
|
|
||||||
dprintf(" drive_number: %u\n", packet->drive_number);
|
|
||||||
dprintf(" controller index: %u\n", packet->controller_index);
|
|
||||||
dprintf(" start emulation: %lu\n", packet->start_emulation);
|
|
||||||
dprintf(" device_specification: %u\n", packet->device_specification);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
platform_get_boot_device(struct stage2_args *args, Node **_device)
|
platform_get_boot_device(struct stage2_args *args, Node **_device)
|
||||||
{
|
{
|
||||||
@ -593,6 +590,7 @@ platform_register_boot_device(Node *device)
|
|||||||
BIOSDrive *drive = (BIOSDrive *)device;
|
BIOSDrive *drive = (BIOSDrive *)device;
|
||||||
|
|
||||||
gKernelArgs.platform_args.boot_drive_number = gBootDriveID;
|
gKernelArgs.platform_args.boot_drive_number = gBootDriveID;
|
||||||
|
check_cd_boot();
|
||||||
|
|
||||||
if (drive->HasParameters()) {
|
if (drive->HasParameters()) {
|
||||||
const drive_parameters ¶meters = drive->Parameters();
|
const drive_parameters ¶meters = drive->Parameters();
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
|
||||||
* Distributed under the terms of the MIT License.
|
|
||||||
*/
|
|
||||||
#ifndef DEVICES_H
|
|
||||||
#define DEVICES_H
|
|
||||||
|
|
||||||
|
|
||||||
#include <SupportDefs.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern void devices_check_cd_boot(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* DEVICES_H */
|
|
@ -11,7 +11,6 @@
|
|||||||
#include "smp.h"
|
#include "smp.h"
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "bios.h"
|
#include "bios.h"
|
||||||
#include "devices.h"
|
|
||||||
|
|
||||||
#include <KernelExport.h>
|
#include <KernelExport.h>
|
||||||
#include <boot/platform.h>
|
#include <boot/platform.h>
|
||||||
@ -75,7 +74,6 @@ platform_start_kernel(void)
|
|||||||
// or I don't see something important...
|
// or I don't see something important...
|
||||||
addr_t stackTop = gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size;
|
addr_t stackTop = gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size;
|
||||||
|
|
||||||
devices_check_cd_boot();
|
|
||||||
mmu_init_for_kernel();
|
mmu_init_for_kernel();
|
||||||
smp_boot_other_cpus();
|
smp_boot_other_cpus();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user