78a072e1b56619e3230735ae073668311232ec94vboxsync; $Id$
78a072e1b56619e3230735ae073668311232ec94vboxsync;; @file
78a072e1b56619e3230735ae073668311232ec94vboxsync; Bootsector2 API definition for use by split images (kernel < 1MB < image).
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync; Copyright (C) 2007-2014 Oracle Corporation
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync; This file is part of VirtualBox Open Source Edition (OSE), as
78a072e1b56619e3230735ae073668311232ec94vboxsync; available from http://www.virtualbox.org. This file is free software;
78a072e1b56619e3230735ae073668311232ec94vboxsync; you can redistribute it and/or modify it under the terms of the GNU
78a072e1b56619e3230735ae073668311232ec94vboxsync; General Public License (GPL) as published by the Free Software
78a072e1b56619e3230735ae073668311232ec94vboxsync; Foundation, in version 2 as it comes in the "COPYING" file of the
78a072e1b56619e3230735ae073668311232ec94vboxsync; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
78a072e1b56619e3230735ae073668311232ec94vboxsync; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync; The contents of this file may alternatively be used under the terms
78a072e1b56619e3230735ae073668311232ec94vboxsync; of the Common Development and Distribution License Version 1.0
78a072e1b56619e3230735ae073668311232ec94vboxsync; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
78a072e1b56619e3230735ae073668311232ec94vboxsync; VirtualBox OSE distribution, in which case the provisions of the
78a072e1b56619e3230735ae073668311232ec94vboxsync; CDDL are applicable instead of those of the GPL.
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync; You may elect to license modified versions of this file under the
78a072e1b56619e3230735ae073668311232ec94vboxsync; terms and conditions of either the GPL or the CDDL or both.
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync%ifndef ___bootsector2_api_mac
78a072e1b56619e3230735ae073668311232ec94vboxsync%define ___bootsector2_api_mac
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;*******************************************************************************
78a072e1b56619e3230735ae073668311232ec94vboxsync;* Header Files *
78a072e1b56619e3230735ae073668311232ec94vboxsync;*******************************************************************************
78a072e1b56619e3230735ae073668311232ec94vboxsync%include "iprt/asmdefs.mac"
78a072e1b56619e3230735ae073668311232ec94vboxsync%include "iprt/x86.mac"
78a072e1b56619e3230735ae073668311232ec94vboxsync%include "bootsector2-structures.mac"
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;;
78a072e1b56619e3230735ae073668311232ec94vboxsync; The load address for big images.
78a072e1b56619e3230735ae073668311232ec94vboxsync%define BS2_BIG_LOAD_ADDR 0x120000
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;;
78a072e1b56619e3230735ae073668311232ec94vboxsync; API Template for lazy birds.
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync%macro BS2_API_TEMPLATE 0,
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(Bs2DisableA20)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(Bs2DisableA20ViaKbd)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(Bs2DisableA20ViaPortA)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(Bs2DisableNX)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(Bs2EnableA20)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(Bs2EnableA20ViaKbd)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(Bs2EnableA20ViaPortA)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(Bs2EnableNX)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(Bs2IsNXSupported)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(Bs2KbdRead)
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync BS2_API_TEMPLATE_ACTION(Bs2KbdWait)
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync BS2_API_TEMPLATE_ACTION(Bs2KbdWrite)
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync BS2_API_TEMPLATE_ACTION(Bs2PanicIfVMMDevTestingIsMissing)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(Bs2SetupNX)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(CalcBenchmarkIterations)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(CalcTestPerSecond)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(GetElapsedNanoTS)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(GetNanoTS)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(PrintChr)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(PrintF)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(PrintStr)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(PrintStrColonSpaces)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(PrintStrSpacesColonSpace)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(PrintU32)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(ReportResult)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(Shutdown)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(StrFormatF)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(StrFormatV)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(StrLen)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestCheckTrap)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestDumpCurrentRegisters)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestDumpRegisters)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestFailed)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestFailedF)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestInit)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestRestoreRegisters)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestSaveRegisters)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(testSendStrCmd)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestSkipped)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestSub)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(testSubCleanup)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestSubDone)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestSubErrorCount)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestTerm)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestValueReg)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestValueU32)
78a072e1b56619e3230735ae073668311232ec94vboxsync BS2_API_TEMPLATE_ACTION(TestInstallTrapRecs)
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync%endmacro
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;;
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync; This defines the API pointers.
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync;
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsyncABSOLUTE 0x500
78a072e1b56619e3230735ae073668311232ec94vboxsync;; Start the structure with a magic number.
78a072e1b56619e3230735ae073668311232ec94vboxsyncNAME(g_u32Bs2ApiMagic): resd 1
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync;; And a version number.
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsyncNAME(g_u32Bs2ApiVersion): resd 1
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; The real mode and v8086 mode entry points (far pointers).
78a072e1b56619e3230735ae073668311232ec94vboxsync%undef BS2_API_TEMPLATE_ACTION
f001a45ec92f71f1e4c1015485fc1ddf84e8059cvboxsync%define BS2_API_TEMPLATE_ACTION(a_Name) NAME(g_pfn %+ a_Name %+ _r86): resd 1
78a072e1b56619e3230735ae073668311232ec94vboxsyncBS2_API_TEMPLATE
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; The 16-bit protected mode entry points (far pointers).
78a072e1b56619e3230735ae073668311232ec94vboxsync%undef BS2_API_TEMPLATE_ACTION
78a072e1b56619e3230735ae073668311232ec94vboxsync%define BS2_API_TEMPLATE_ACTION(a_Name) NAME(g_pfn %+ a_Name %+ _p16): resd 1
78a072e1b56619e3230735ae073668311232ec94vboxsyncBS2_API_TEMPLATE
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; The 32-bit protected mode entry points (flat pointers).
78a072e1b56619e3230735ae073668311232ec94vboxsync%undef BS2_API_TEMPLATE_ACTION
78a072e1b56619e3230735ae073668311232ec94vboxsync%define BS2_API_TEMPLATE_ACTION(a_Name) NAME(g_pfn %+ a_Name %+ _p32): resd 1
78a072e1b56619e3230735ae073668311232ec94vboxsyncBS2_API_TEMPLATE
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync; The 64-bit protected (long) mode entry points.
78a072e1b56619e3230735ae073668311232ec94vboxsync%undef BS2_API_TEMPLATE_ACTION
78a072e1b56619e3230735ae073668311232ec94vboxsync%define BS2_API_TEMPLATE_ACTION(a_Name) NAME(g_pfn %+ a_Name %+ _p64): resq 1
78a072e1b56619e3230735ae073668311232ec94vboxsyncBS2_API_TEMPLATE
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;; End the structure with a magic so it's integrity can be verified.
78a072e1b56619e3230735ae073668311232ec94vboxsyncNAME(g_u32Bs2ApiEndMagic) resd 1
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;;
78a072e1b56619e3230735ae073668311232ec94vboxsync; The current API magic value (Douglas Carl Engelbart).
78a072e1b56619e3230735ae073668311232ec94vboxsync%define BS2_API_MAGIC 0x19250130
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;;
78a072e1b56619e3230735ae073668311232ec94vboxsync; The current API version.
78a072e1b56619e3230735ae073668311232ec94vboxsync%define BS2_API_VERSION 0x00010000
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncBEGINCODE
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;; @name Service trap vector interface.
78a072e1b56619e3230735ae073668311232ec94vboxsync; @{
78a072e1b56619e3230735ae073668311232ec94vboxsync%define BS2_SYSCALL_TO_RING0 0
78a072e1b56619e3230735ae073668311232ec94vboxsync%define BS2_SYSCALL_TO_RING1 1
78a072e1b56619e3230735ae073668311232ec94vboxsync%define BS2_SYSCALL_TO_RING2 2
78a072e1b56619e3230735ae073668311232ec94vboxsync%define BS2_SYSCALL_TO_RING3 3
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;; The service vector.
78a072e1b56619e3230735ae073668311232ec94vboxsync%define BS2_TRAP_SYSCALL 20h
78a072e1b56619e3230735ae073668311232ec94vboxsync;; @}
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync%endif
78a072e1b56619e3230735ae073668311232ec94vboxsync