From 9776e38eb1ef45a84083c8e7af207225e06c9174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Wed, 2 Jan 2008 22:05:28 +0000 Subject: [PATCH] smp ? me no know about smp here... This will be the stage 1 loader... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23222 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/atari_m68k/menu.cpp | 2 +- src/system/boot/platform/atari_m68k/stage1.S | 66 ++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 src/system/boot/platform/atari_m68k/stage1.S diff --git a/src/system/boot/platform/atari_m68k/menu.cpp b/src/system/boot/platform/atari_m68k/menu.cpp index d2e6014bee..26727a99da 100644 --- a/src/system/boot/platform/atari_m68k/menu.cpp +++ b/src/system/boot/platform/atari_m68k/menu.cpp @@ -28,9 +28,9 @@ platform_add_menus(Menu *menu) item->SetData(B_SAFEMODE_FAIL_SAFE_VIDEO_MODE); item->SetHelpText("The system will use VESA mode and won't try to open any video graphics driver"); +#if 0 smp_add_safemode_menus(menu); -#if 0 menu->AddItem(item = new(nothrow) MenuItem("Don't call the BIOS")); item->SetType(MENU_ITEM_MARKABLE); diff --git a/src/system/boot/platform/atari_m68k/stage1.S b/src/system/boot/platform/atari_m68k/stage1.S new file mode 100644 index 0000000000..e6b40dc867 --- /dev/null +++ b/src/system/boot/platform/atari_m68k/stage1.S @@ -0,0 +1,66 @@ +/* + * Copyright 2005, Ingo Weinhold, bonefish@users.sf.net. + * Copyright 2007, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT license. + * + * Author: + * François Revol, revol@free.fr. + */ + +#define FUNCTION(x) .global x; .type x,@function; x + +/* + * stage1 boot code for TOS for use as boot block of HDD partitions. + * cf. + * http://www.fortunecity.com/skyscraper/apple/308/html/chap3.htm + * http://leonard.oxg.free.fr/articles/multi_atari/multi_atari.html + * http://alive.atari.org/alive10/btmania.php + * + * The offset of the partition in 512 byte blocks must be written at + * position PARTITION_OFFSET_OFFSET (32 bit little endian; makebootable does + * that) or otherwise the code can't find the partition. + * The partition must be a BFS formatted. The file "beos/system/zbeos" + * (the stage 2 boot loader) loaded into memory at 0x1000:0x0000 (linear address + * 0x10000) and entered at 0x:1000:0x0200 with parameters eax - partition offset + * in 512 byte blocks and dl - BIOS ID of the boot drive. + * + * Compile via: + * nasm -f bin -O5 -o stage1.bin stage1.S + */ + +// 1 enabled verbose output +//#define DEBUG 1 + + +#define BOOT_BLOCK_START_ADDRESS 0x7c00 +#define STACK_ADDRESS BOOT_BLOCK_START_ADDRESS +#define READ_BUFFER_STACK STACK_ADDRESS - 0x2000 +#define PARTITION_OFFSET_OFFSET 506 +#define BFS_SUPERBLOCK_OFFSET 512 + + +// BFS definitions + +#define SUPER_BLOCK_MAGIC1 '1SFB' ; nasm reverses '...' consts +#define SUPER_BLOCK_MAGIC2 0xdd121031 +#define SUPER_BLOCK_MAGIC3 0x15b6830e + +#define INODE_MAGIC1 0x3bbe0ad9 + +#define NUM_DIRECT_BLOCKS 12 + +#define S_IFMT 00000170000o +#define S_IFDIR 00000040000o + + +// BIOS calls + + + + + + + rts + + +