From: Jack Lange Date: Tue, 22 Jul 2008 05:31:11 +0000 (+0000) Subject: automatic setup of large floppy disk image X-Git-Tag: vmmhack1-ramdisk-boot-iso-puppy~60 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=647775a7f1503a837f53d5e2afd15e8e2594d75d;p=palacios-OLD.git automatic setup of large floppy disk image --- diff --git a/palacios/build/Makefile b/palacios/build/Makefile index 79f3d7d..0512886 100644 --- a/palacios/build/Makefile +++ b/palacios/build/Makefile @@ -1,6 +1,6 @@ # Makefile for GeekOS kernel, userspace, and tools # Copyright (c) 2004,2005 David H. Hovemeyer -# $Revision: 1.48 $ +# $Revision: 1.49 $ # This is free software. You are permitted to use, # redistribute, and modify it as specified in the file "COPYING". @@ -82,7 +82,7 @@ endif # # and make world will build an empty boot package # -XED=0 +XED=1 ifeq ($(DEBUG),1) JRLDEBUG= -DSERIAL_PRINT_DEBUG=1 -DSERIAL_PRINT_DEBUG_LEVEL=10 -DSERIAL_PRINT=1 -DVMM_DEBUG=1 -DVMM_INFO=1 -DVMM_TRACE=1 $(DEBUG_SECTIONS) @@ -265,8 +265,8 @@ ZEROFILE := $(PERL) $(PROJECT_ROOT)/scripts/zerofile NUMSECS := $(PERL) $(PROJECT_ROOT)/scripts/numsecs -#Round a value up to a certain factor (hex values) -ROUND_UP_HEX := $(PERL) $(PROJECT_ROOT)/scripts/round_up_hex.pl +FD_SECTORS_PER_TRACK := $(PERL) $(PROJECT_ROOT)/scripts/numsecs_per_track + # ---------------------------------------------------------------------- # Definitions - @@ -398,6 +398,7 @@ geekos/fd_boot.bin : geekos/setup.bin geekos/kernel.bin $(PROJECT_ROOT)/src/geek -I$(PROJECT_ROOT)/src/geekos/ \ -DNUM_SETUP_SECTORS=`$(NUMSECS) geekos/setup.bin` \ -DNUM_KERN_SECTORS=`$(NUMSECS) geekos/kernel.bin` \ + -DSECTORS_PER_TRACK=`$(FD_SECTORS_PER_TRACK) geekos/kernel.bin geekos/setup.bin` \ $(PROJECT_ROOT)/src/geekos/fd_boot.asm \ -o $@ diff --git a/palacios/scripts/numsecs_per_track b/palacios/scripts/numsecs_per_track new file mode 100755 index 0000000..b875a89 --- /dev/null +++ b/palacios/scripts/numsecs_per_track @@ -0,0 +1,30 @@ +#! /usr/bin/perl + +# Find the number of 512-byte sectors needed to store +# given file. + +# $Revision: 1.1 $ + +use strict qw(refs vars); + +my $sectors = 0; +my $filename = ""; + +foreach $filename (@ARGV) { + + my $size = (-s $filename ); + die "Couldn't get size of $filename: $!" if ( !defined $size ); + + my $result = int($size / 512); + my $remainder = $size % 512; + $result++ if ( $remainder > 0 ); + + $sectors += $result; +} + +if ($sectors <= 2879) { + print "18\n"; +} else { + print "36\n"; +} + diff --git a/palacios/src/geekos/defs.asm b/palacios/src/geekos/defs.asm index 25dc811..6c5ce15 100644 --- a/palacios/src/geekos/defs.asm +++ b/palacios/src/geekos/defs.asm @@ -1,6 +1,6 @@ ; Definitions for use in GeekOS boot code ; Copyright (c) 2001, David H. Hovemeyer -; $Revision: 1.7 $ +; $Revision: 1.8 $ ; This is free software. You are permitted to use, ; redistribute, and modify it as specified in the file "COPYING". @@ -54,7 +54,7 @@ VIDSEG equ 0xb800 ; The following information is correct for a 1.44M floppy. ; Yes, I'm hard coding this. -SECTORS_PER_TRACK equ 18 +;SECTORS_PER_TRACK equ 18 HEADS equ 2 CYLINDERS equ 80