boot0.S empty #ifdef

John Baldwin jhb at freebsd.org
Fri Dec 9 12:51:36 UTC 2011


On Monday, December 05, 2011 2:30:30 pm some body wrote:
> I am starting to learn how the kernel works and have started by going
> through the boot loader and I've noticed that between lines 21-32 in
> boot0.S there are some empty #ifdef statements. I was wondering a) where
> are these paramaters defined and if they are defined, what difference does
> it make since it looks like it doesn't change anything since they're empty?
> 
> 
> #ifdef SIO
> #endif
> 
> #ifdef CHECK_DRIVE
> #endif
> 
> #ifdef ONLY_F_KEYS
> #endif

It seems the point of these is to document what they do (note that you left 
out the comments):

/* build options: */
#ifdef SIO              /* use serial console on COM1.  */
#endif

#ifdef PXE              /* enable PXE/INT18 booting with F6 */
#define SAVE_MORE_MEMORY
#endif

#ifdef CHECK_DRIVE      /* make sure we boot from a HD. */
#endif

#ifdef ONLY_F_KEYS      /* Only F1..F6, no digits on console */
#endif

#ifdef VOLUME_SERIAL    /* support Volume serial number */
#define B0_BASE 0x1ae   /* move the internal data area */
#define SAVE_MEMORY
#else
#define B0_BASE 0x1b2
#endif

#ifdef TEST             /* enable some test code */
#define SAVE_MEMORY
#define SAVE_MORE_MEMORY
#endif

-- 
John Baldwin


More information about the freebsd-drivers mailing list