Sync push
This commit is contained in:
parent
7f3530ea78
commit
412b3601fc
10 changed files with 27 additions and 8 deletions
Binary file not shown.
Binary file not shown.
|
|
@ -3,11 +3,11 @@
|
|||
.entry _kernel0_main
|
||||
.header KERNEL0_BOOT
|
||||
|
||||
@include <../../sdk/bios_api.dss>
|
||||
@include <../../sdk/palette.dss>
|
||||
@include <../drivers/keyboard_driver.dss>
|
||||
@include <../drivers/display_driver.dss>
|
||||
@include <../drivers/keyboard_driver.dss>
|
||||
@include <../../sdk/bios_api.dss>
|
||||
@include <memory.dss>
|
||||
@include <../../sdk/palette.dss>
|
||||
|
||||
|
||||
## =========================================================================================================================
|
||||
|
|
|
|||
|
|
@ -1,7 +1,16 @@
|
|||
@guard _MEMORY_DSS_
|
||||
|
||||
@define _REG_OFFSET 0x09
|
||||
@define _REG_S1 0x07
|
||||
@define _REG_S2 0x08
|
||||
|
||||
@define _USABLE_MEM_START 0x353F
|
||||
@define _USABLE_MEM_SIZE 0xBAC0
|
||||
@define _MEM_TABLE_ADDR 0x30FF
|
||||
|
||||
.code
|
||||
|
||||
_init_memory_handler:
|
||||
mov R6, 0xFAAA
|
||||
ret
|
||||
|
||||
_alloc_memory:
|
||||
|
|
@ -32,6 +32,7 @@
|
|||
SCREEN_WIDTH { MemoryAddresses.CMOS + 0x0007 }
|
||||
SCREEN_HEIGHT { MemoryAddresses.CMOS + 0x0009 }
|
||||
BOOT_DISK { MemoryAddresses.CMOS + 0x0010 }
|
||||
STACK_SIZE { MemoryAddresses.CMOS + 0x0011 }
|
||||
|
||||
DISK_LIST { MemoryAddresses.CMOS + 0x007E }
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
## --
|
||||
## -- This file is automatically generated by the DragonAssembler (version 0.4.1620)
|
||||
## -- This file is automatically generated by the DragonAssembler (version 0.4.1621)
|
||||
## -- Please do not modify this file in any way.
|
||||
## --
|
||||
|
||||
|
|
@ -24,6 +24,7 @@
|
|||
SCREEN_WIDTH { MemoryAddresses.CMOS + 0x0007 }
|
||||
SCREEN_HEIGHT { MemoryAddresses.CMOS + 0x0009 }
|
||||
BOOT_DISK { MemoryAddresses.CMOS + 0x0010 }
|
||||
STACK_SIZE { MemoryAddresses.CMOS + 0x0011 }
|
||||
DISK_LIST { MemoryAddresses.CMOS + 0x007E }
|
||||
@end
|
||||
## --
|
||||
|
|
|
|||
|
|
@ -66,8 +66,6 @@ namespace dragon
|
|||
{
|
||||
ostd::String line = lines[i];
|
||||
line.trim();
|
||||
if (line.new_toLower().contains("memory.dss"))
|
||||
std::cout << line << "\n";
|
||||
if (line.new_toLower().startsWith("@include") && line.len() > 8)
|
||||
{
|
||||
line.substr(8).trim();
|
||||
|
|
|
|||
|
|
@ -61,6 +61,13 @@ namespace dragon
|
|||
void VirtualCPU::pushToStack(int16_t value)
|
||||
{
|
||||
uint16_t stackAddr = readRegister(data::Registers::SP);
|
||||
uint16_t stack_size = DragonRuntime::vCMOS.read16(data::CMOSRegisters::StackSize);
|
||||
if (stackAddr <= 0xFFFF - stack_size)
|
||||
{
|
||||
data::ErrorHandler::pushError(data::ErrorCodes::CPU_StackOverflow, "Stack Overflow: ");
|
||||
m_halt = true;
|
||||
return;
|
||||
}
|
||||
m_memory.write16(stackAddr, value);
|
||||
writeRegister16(data::Registers::SP, stackAddr - 2);
|
||||
m_stackFrameSize += 2;
|
||||
|
|
|
|||
|
|
@ -322,6 +322,7 @@ namespace dragon
|
|||
vCMOS.write8(data::CMOSRegisters::ScreenRedrawRate, machine_config.screen_redraw_rate_per_second);
|
||||
vCMOS.write16(data::CMOSRegisters::ScreenWidth, static_cast<int16_t>(RawTextRenderer::CONSOLE_CHARS_H));
|
||||
vCMOS.write16(data::CMOSRegisters::ScreenHeight, static_cast<int16_t>(RawTextRenderer::CONSOLE_CHARS_V));
|
||||
vCMOS.write16(data::CMOSRegisters::StackSize, 0x1000);
|
||||
ostd::BitField_16 disk_list_bitfield;
|
||||
disk_list_bitfield.value = 0;
|
||||
for (int32_t i = 0; i < 16; i++)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ namespace dragon
|
|||
|
||||
inline static constexpr uint64_t CPU_UnknownInstruction = 0x2000000000000000;
|
||||
inline static constexpr uint64_t CPU_UnsupportedExtension = 0x2000000000000001;
|
||||
inline static constexpr uint64_t CPU_StackOverflow = 0x2000000000000002;
|
||||
|
||||
inline static constexpr uint64_t BIOS_FailedToLoad = 0x3000000000000000;
|
||||
inline static constexpr uint64_t BIOS_InvalidSize = 0x3000000000000001;
|
||||
|
|
@ -223,6 +224,7 @@ namespace dragon
|
|||
inline static constexpr uint8_t ScreenWidth = 0x07;
|
||||
inline static constexpr uint8_t ScreenHeight = 0x09;
|
||||
inline static constexpr uint8_t BootDisk = 0x10;
|
||||
inline static constexpr uint8_t StackSize = 0x11;
|
||||
|
||||
inline static constexpr uint8_t DiskList = 0x7E;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue