Subject: Re: proplib(3) in i386 bootstrap
To: M J Fleming <mjf@NetBSD.org>
From: SODA Noriyuki <soda@sra.co.jp>
List: tech-userlevel
Date: 01/10/2007 17:32:57
>>>>> On Tue, 9 Jan 2007 20:27:35 +0000, M J Fleming <mjf@NetBSD.org> said:

> I'm wanting to use proplib for the configuration file and wrote the code
> to handle this,

I don't think proplib syntax is suitable for configuration files which
will be directly edited by our users.

Compare the following examples:

1. tranditional custom syntax

	timeout 15
	consdev com1
	rootdev wd0e
	boot hd0a:/netbsd

2. custom XML schema

	<?xml version="1.0"?>
	<!DOCTYPE .......>
	<timeout>15</timeout>
	<boot kernel="hd0a:/netbsd" console="com1" root="wd0e"/>

3. proplib XML

	<dict>
	<key>timeout</key><integer>15</integer>
	<key>consdev</key><string>com1</string>
	<key>rootdev</key><string>wd0e</string>
	<key>boot</key><string>hd0a:/netbsd</string>
	</dict>

I think 1 is best.
In this way, you can share the parser for the boot prompt with the
parser for the configuration file.

And I think 3 is worst.
Why do we force our users to write these needless <integer>...</integer>,
<string>...</string>, etc?

The boot loader should include the parser for the boot prompt,
so that parse should be used for the configuration file too.
-- 
soda