Pierre-Alexandre Meyer [Mon, 7 Sep 2009 21:44:34 +0000 (14:44 -0700)]
cmenu: force refresh after checkbox_handler in complex.c
complex.c has a special checkbox_handler that disables mutual exclusive
entries. This works today because each key press triggers a redraw of the whole
menu. We can't rely on this if we want to optimize the redraw.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Mon, 7 Sep 2009 18:18:13 +0000 (11:18 -0700)]
cmenu: redraw menu when exiting keys_handler
The keys_handler can change the UI (e.g. the help system draws a black
background by default). We need to redraw the background and title on exit.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Mon, 7 Sep 2009 18:00:34 +0000 (11:00 -0700)]
cmenu: pad help filename with 0 instead of spaces
The manual states that the help filename format is hlp<NNNNN>.txt where
<NNNNN> is the helpid.
If the helpid contains less than 5 digits, pad with zero, not spaces,
i.e. look for hlp00023.txt, not hlp 23.txt.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sun, 6 Sep 2009 07:49:27 +0000 (00:49 -0700)]
cmenu: remove obsolete com32io code
Remove legacy scrollupwindow definition and checkkbdbuf declaration.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sun, 6 Sep 2009 07:48:14 +0000 (00:48 -0700)]
cmenu: make the help menu actually work
With the recent changes in cmenu, the help feature was completely broken.
Fix it.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sun, 6 Sep 2009 07:46:55 +0000 (00:46 -0700)]
hdt: fix build due to cmenu keyboard changes
Sames changes as the ones needed on the cmenu examples.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sun, 6 Sep 2009 05:59:00 +0000 (22:59 -0700)]
libansi: add function to scroll up multiple lines
Impact: API change. scrollup() has been renamed scrollup_once().
Use scrollup(nb_of_lines) to specify the number of lines the window needs
to scroll.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sun, 6 Sep 2009 05:55:28 +0000 (22:55 -0700)]
cmenu: fix handlers signature in the examples
The keys handler accepts three arguments: the current menu system, the current
menu entry and the key pressed.
Misc: fix timeout in complex.c to actually be 10 seconds.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sun, 6 Sep 2009 05:51:04 +0000 (22:51 -0700)]
cmenu: use get_key library for keyboard functions
Syslinux already uses a get_key library to handle stdin. Let's leverage it.
cmenu now works over serial completely.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 5 Sep 2009 18:42:29 +0000 (11:42 -0700)]
libansi: correctly reset attributes
When resetting the attributes, we were updating last_attr to the unknown value
0x300, which doesn't always work.
For instance, when requesting reset and normal attributes, i.e.
"\e[0;30;47m" with the previous attribute being "\e[1;30;47m", we where printing
"\e[0;47m", which behaves like "\e[0;39;47m". This is incorrect.
This patch adds a flag to explicitly set background and foreground colors after
a reset.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 5 Sep 2009 18:35:09 +0000 (11:35 -0700)]
libansi: reset_colors should use csprint
cprint_vga2ansi takes only a char, not a string.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 5 Sep 2009 18:22:36 +0000 (11:22 -0700)]
cmenu: fill backgorund with printable character
To have a blue background on the console (serial), we need to fill
the screen with a printable character (e.g. space).
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 5 Sep 2009 17:26:45 +0000 (10:26 -0700)]
cmenu: remove legacy CHABSATTR/CHRELATTR code
CHABSATTR and CHRELATTR have been replaced by SO/SI.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 5 Sep 2009 17:23:00 +0000 (10:23 -0700)]
cmenu: remove legacy box drawing code
Lines are now printed via the Line Drawing Character Set.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 5 Sep 2009 17:20:48 +0000 (10:20 -0700)]
cmenu: unify normal menu/radio menu handling
A lot of code was duplicated between regular and normal menus
(menu printing and selection handling). This patch unifies this logic
by adding an extra bool in printmenu() and getmenuoption() to distinguish
between the two types of menus.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 5 Sep 2009 17:15:35 +0000 (10:15 -0700)]
cmenu: fix Login/Password and Kernel Arguments lines (complex.c)
Update the cmenu example complex.c to use clear_line(): cprint behavior has
changed w.r.t. cursor positioning (it is automatically advanced now).
Note: need to reset the colors before clearing the line since the status bar is
printed just before the Kernel Arguments line and it changes the background
color.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 5 Sep 2009 17:14:24 +0000 (10:14 -0700)]
libansi: add reset_colors function
Purpose of reset_colors is to reset the attribute to VGA 0x07.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 5 Sep 2009 04:17:43 +0000 (21:17 -0700)]
cmenu: turn off auto wrap
Auto wrap made the menu scroll because of the status line (when printing
the last character of the bottom right of the screen, the ansicon scrolled
the whole menu).
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
H. Peter Anvin [Fri, 14 Aug 2009 05:35:28 +0000 (22:35 -0700)]
ansi: add support for no-wrap mode, cleanups
Add support for nowrap mode CSI ? 7 l (unfortunately, on ANSI.SYS it
is CSI = 7 l; which means that the only way to support both is to
print both sequences and then erase the resulting garbage.)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Pierre-Alexandre Meyer [Fri, 4 Sep 2009 23:59:53 +0000 (16:59 -0700)]
Merge commit 'origin/libansi' into cmenu-video
Pierre-Alexandre Meyer [Fri, 4 Sep 2009 23:54:24 +0000 (16:54 -0700)]
Merge branch 'cmenu-video' of git://git.zytor.com/users/pam/hdt-pierre into cmenu-video
Pierre-Alexandre Meyer [Thu, 3 Sep 2009 22:43:54 +0000 (15:43 -0700)]
cmenu: use printf instead of csprint with default attribute
We don't change the attribute in the help screen. Refactor the code
to simply use printf.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Thu, 3 Sep 2009 22:23:22 +0000 (15:23 -0700)]
cmenu: use putchar instead of putch when using default attribute
There is no real need to do putch('x', 0x07), 0x07 being the default
VGA attribute. Use putchar instead.
Note that showhelp will trigger a drawbox first with 0x07 as attribute.
Since we don't update the attribute, it is guaranteed to still be 0x07
when invoking putch.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Thu, 3 Sep 2009 21:31:27 +0000 (14:31 -0700)]
hdt: remove call to legacy getnumcols (menu)
Use getscreensize instead.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Thu, 3 Sep 2009 21:16:17 +0000 (14:16 -0700)]
cmenu: use getscreensize to access number of rows/columns
The simple menu system already uses getscreensize. Another step towards
unification.
Impact: exported getnumcols and getnumrows are now deprecated.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Tue, 1 Sep 2009 20:30:20 +0000 (13:30 -0700)]
libansi: fix compiler warnings
Fix "warning: function declaration isn't a prototype" warnings.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Tue, 1 Sep 2009 18:33:40 +0000 (11:33 -0700)]
hdt: switch to libansi
Make hdt use libansi.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Tue, 1 Sep 2009 18:32:44 +0000 (11:32 -0700)]
cmenu: switch to libansi
Make cmenu use libansi.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Tue, 1 Sep 2009 18:32:03 +0000 (11:32 -0700)]
libansi: add missing prototype in the header
clearwindow() was not presented in libansi.h.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Tue, 1 Sep 2009 18:30:32 +0000 (11:30 -0700)]
libansi: build libansi.o
Hook libansi.o into the lib/ build.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Tue, 1 Sep 2009 18:13:11 +0000 (11:13 -0700)]
libansi: move to lib directory, as it is MIT, not GPL licensed
gplinclude/gpllib should be used for external, GPL, libraries
only. libansi has been developed for Syslinux and is MIT licensed.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Tue, 1 Sep 2009 18:07:07 +0000 (11:07 -0700)]
gpllib: add more ANSI functions
Import the functions that I introduced in cmenu.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Mon, 31 Aug 2009 22:59:17 +0000 (15:59 -0700)]
gpllib: add a new ansi library
HDT and cmenu are currently duplicating code: they both define their
own mini ansi library.
This patch extracts the HDT ansi lib into gpllib as a first step towards
unification.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Mon, 31 Aug 2009 06:47:46 +0000 (23:47 -0700)]
cmenu: reset attributes instead of using ANSI sequence 22
hpa advised not to use ANSI sequence 22, as it may not work everywhere.
Instead, let's reset attributes and set last_attr to unknown. The next
background/foreground tests are then guaranteed to fire. We take a small
hit in terms of performance though.
Misc.: change initialization of last_attr to 0x300 (unknown) to trigger
properly the tests the first time.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Mon, 31 Aug 2009 06:37:01 +0000 (23:37 -0700)]
cmenu: fix background color
The menu highlights some characters to mark them as key shortcuts.
To switch the bold attribute off, we were printing the reset code,
resetting the background color in the same time.
Use ANSI sequence 22 instead.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Mon, 31 Aug 2009 00:14:02 +0000 (17:14 -0700)]
Revert "ansicon: allow to pass page # to write functions"
We shouldn't be using any pages, as there is no support on the
serial line.
This reverts commit
e9b317fd0dc87dc93a49bc40520f4bdd0264d746.
Pierre-Alexandre Meyer [Mon, 31 Aug 2009 00:11:33 +0000 (17:11 -0700)]
cmenu: use 80x25 as terminal size by default
Let's not rely on the geometry returned by the BIOS for the
terminal size - we don't know anything about the one used via serial.
We now default to 80x25, regardless of what the BIOS returns.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Mon, 31 Aug 2009 00:09:52 +0000 (17:09 -0700)]
cmenu: misc. cleanups
Fix a compiler warning and a header documentation.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Mon, 31 Aug 2009 00:06:30 +0000 (17:06 -0700)]
cmenu: remove multi pages support
The cmenu used to display the help on a separate page. Since we
can't have multi pages on the serial line, get rid of them completely.
This has a fairly big impact as the external cmenu API has changed.
adv_menu.tpl and HDT have been patched accordingly.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sun, 30 Aug 2009 03:55:34 +0000 (20:55 -0700)]
cmenu: use < for menu exit character
Use plain '<' as the "back" symbol.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sun, 30 Aug 2009 03:53:38 +0000 (20:53 -0700)]
cmenu: fix menu separators
Use the alternate character set to draw horizontal lines (menu
separator). Refactor the c*print functions in the same time as they
were severely broken.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 29 Aug 2009 18:26:17 +0000 (11:26 -0700)]
cmenu: use > instead of ยป for submenus
ยป doesn't exist in the alternate character set. Use plain
> instead.
Misc.: fix SO/SI invocation, putchar takes a char, fputs a string.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 29 Aug 2009 05:38:08 +0000 (22:38 -0700)]
cmenu: remove extra getboxchars call
getboxchars is not used anymore in drawbox. Let's get rid of it.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 29 Aug 2009 05:28:05 +0000 (22:28 -0700)]
cmenu: build cleanups
Fix build warnings and remove old cls declaration.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 29 Aug 2009 05:27:22 +0000 (22:27 -0700)]
cmenu: refactor cswprint function
Now that cprint is smarter, cswprint can be simplified.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 29 Aug 2009 05:21:00 +0000 (22:21 -0700)]
cmenu: refactor printmenuitem function
Simplify the printmenuitem function, now that putch is smarter.
Pierre-Alexandre Meyer [Sat, 29 Aug 2009 05:14:10 +0000 (22:14 -0700)]
cmenu: refactor beep function
Use \007 to make the system beep. Note "\007" works, but not '\007'.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 29 Aug 2009 05:09:53 +0000 (22:09 -0700)]
cmenu: refactor cprint functions
Some refactoring:
* Make cprint_vga2ansi static, as it is an internal function.
* Simplify the logic in cprint().
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 29 Aug 2009 05:06:12 +0000 (22:06 -0700)]
cmenu: use VT-100 alternate character set for drawing boxes
Use the Special Characters and Line Drawing Character Set as
described in http://www.vt100.net/docs/vt102-ug/table5-13.html
to draw boxes around the menus.
Note that to work in xterm, G1 needs to be initialized (to point
to the alternate character set). This is done in the cls function
("\033)0").
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Fri, 21 Aug 2009 15:37:06 +0000 (08:37 -0700)]
cmenu: remove unused bit_reverse function
Not needed anymore: we use a lookup table (ansi_char)
in cprint_vga2ansi now to reverse Background and Foreground bits..
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Fri, 21 Aug 2009 06:00:25 +0000 (23:00 -0700)]
cmenu: better implementation of vga->ansi
hpa suggested a better implementation, that also fixes some color
issues and invalid ANSI codes. Thanks hpa!
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Fri, 21 Aug 2009 05:02:50 +0000 (22:02 -0700)]
cmenu: implement cprint using printf
First step towards a usable menu. Color is now sent over serial.
Testing Done: launched HDT over serial. The background got drawn blue,
as expected.
Note: vga attributes need to be converted to ansi codes.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Wed, 19 Aug 2009 04:55:41 +0000 (21:55 -0700)]
cmenu: remove unused getchar function
char getchar(void) doesn't seem to be used.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Wed, 19 Aug 2009 04:20:54 +0000 (21:20 -0700)]
cmenu: implement scrollup using SU escape sequence
Use the ANSI SU - Scroll Up escape sequence to scrollup the window.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Wed, 19 Aug 2009 04:09:09 +0000 (21:09 -0700)]
cmenu: implement gotoxy using escape sequences
Use ansicon and the ANSI CUP - CUrsor Position escape sequence
to implement the gotoxy function.
Note: page switching is not supported (yet).
Testing Done: ran com32/cmenu/test.c32 in qemu.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Tue, 11 Aug 2009 15:58:19 +0000 (08:58 -0700)]
ansicon: allow to pass page # to write functions
Some video modes support up to 8 different pages, the current one being
stored at 0x462.
The display page value is passed in BH when invoking the INT 10h Video
Service routines. This patch changes the interface of ansicon_write_char
and ansicon_set_cursor to allow the caller to specify the page.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
H. Peter Anvin [Wed, 26 Aug 2009 04:19:26 +0000 (21:19 -0700)]
NEWS: update for 3.83
Pierre-Alexandre Meyer [Sat, 22 Aug 2009 18:08:04 +0000 (11:08 -0700)]
hdt: enhance error reporting in the CLI (disk)
parse_partition_table can fail for two reasons: disk I/O
error or unrecognized partition layout (non msdos, corrupt, ...).
In the latter case, we were displaying
Error parsing disk 0x80
parse_partition_table: error 0
which is confusing. We now display
Disk 0x80: unrecognized partition layout
or the errno_disk in case of I/O errors.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 22 Aug 2009 17:34:40 +0000 (10:34 -0700)]
hdt: make get_error behaves like perror
This simplifies buffer handling.
Misc.: clean some old error code handling.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Sat, 22 Aug 2009 16:42:37 +0000 (09:42 -0700)]
hdt: fix CLI crash when parsing unsupported geometries
Remove extra free() calls: these were needed before the introduction
of the disklib errno. We apparently forgot to remove them.
Reported-by: Gert Hulselmans <hulselmansgert@gmail.com>
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
erwan [Thu, 20 Aug 2009 04:24:16 +0000 (06:24 +0200)]
hdt: 0.3.4
Impact: New release
0.3.4 is now out !
Pierre-Alexandre Meyer [Thu, 20 Aug 2009 04:20:40 +0000 (21:20 -0700)]
hdt: fix disklib display
We currently display the first sector after the end of an extended.
Fix it (-1).
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Thu, 20 Aug 2009 04:12:57 +0000 (21:12 -0700)]
disklib: fix extended partition code
gert1 reported some issues using disklib with HDT. As it turned out, the
code that iterated through ebrs in an extended partition was broken: ebr offsets
need to be relative to the start of that partition.
Misc.: fix memory leak.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Signed-off-by: Erwan Velu <erwan.velu@free.fr>
erwan [Wed, 19 Aug 2009 22:19:44 +0000 (00:19 +0200)]
hdt: Fixing memory corruption
Impact: Improve stability
In some case, sectors_to_size can return a 8 char long string like "1000
MiB". In such case, some buffer were corrupted.
This is now fixed by a size[9] instead of size[8].
erwan [Wed, 19 Aug 2009 21:50:50 +0000 (23:50 +0200)]
Merge branch 'master' of git://git./boot/syslinux/syslinux into origin/master
Erwan Velu [Wed, 19 Aug 2009 19:17:49 +0000 (21:17 +0200)]
Merge commit 'pam/disklib-fixes'
Pierre-Alexandre Meyer [Wed, 19 Aug 2009 04:14:16 +0000 (21:14 -0700)]
Merge branch 'master' of git://git./boot/syslinux/syslinux into cmenu-video
H. Peter Anvin [Tue, 18 Aug 2009 02:06:01 +0000 (19:06 -0700)]
MEMDISK: generate map files
Generate map files to make debugging less painful.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Mon, 17 Aug 2009 02:51:38 +0000 (19:51 -0700)]
memdisk: make the stack size configurable
Make it possible to configure the stack size on the command line,
so that we can rule that out in case of problems.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Mon, 17 Aug 2009 19:26:08 +0000 (12:26 -0700)]
menu: initialize cm (current menu) before empty check
The empty check in the menu system used "cm", but before "cm" had
actually been initialized. Move the "cm" initialization earlier so we
do the right thing here.
Reported-by: CKSoon <cksoon79@yahoo.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Sat, 15 Aug 2009 00:22:01 +0000 (17:22 -0700)]
Merge commit 'origin/master'
H. Peter Anvin [Fri, 14 Aug 2009 05:31:13 +0000 (22:31 -0700)]
menu: fix Ctrl-W (word erase) when editing a command line
The Ctrl-W (word erase) key was broken: it would think the command
line got longer, not shorter, resulting in havoc.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Thu, 13 Aug 2009 22:27:46 +0000 (15:27 -0700)]
Revert "Run Nindent on com32/include/pngconf.h"
This reverts commit
6361b71f87466877f8fd1273240e8fa4460f8d05.
<pngconf.h> is part of libpng, it should never have been Nindented.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Thu, 13 Aug 2009 22:26:49 +0000 (15:26 -0700)]
Revert "Run Nindent on com32/include/png.h"
This reverts commit
ab7b6c3380cd9188edbc99693d5562dcca055317.
<png.h> is part of libpng and hence externally maintained; it should
not have been Nindented.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Pierre-Alexandre Meyer [Tue, 11 Aug 2009 15:58:19 +0000 (08:58 -0700)]
ansicon: allow to pass page # to write functions
Some video modes support up to 8 different pages, the current one being
stored at 0x462.
The display page value is passed in BH when invoking the INT 10h Video
Service routines. This patch changes the interface of ansicon_write_char
and ansicon_set_cursor to allow the caller to specify the page.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
H. Peter Anvin [Mon, 10 Aug 2009 18:18:12 +0000 (11:18 -0700)]
zlib: remove unused sample programs
Remove unused sample programs (example.c, minigzip.c); we don' tuse
them and they are just noise.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Sun, 9 Aug 2009 22:52:26 +0000 (15:52 -0700)]
zlib: kill gzio.c
Remove gzio.c, which is a zlib-specific stdio-like interface. We
implement this in the actual filesystem layer, which is much cleaner.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Pierre-Alexandre Meyer [Thu, 6 Aug 2009 04:31:13 +0000 (21:31 -0700)]
hdt: Remove extra more_printf calls
Let's rather use string concatenation.
Reported-by: Shao Miller <Shao.Miller@yrdsb.edu.on.ca>
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Thu, 6 Aug 2009 04:03:04 +0000 (21:03 -0700)]
gpllib: Introduce typedefs for callbacks
typedefs are evil but useful for function pointers as it makes them more
readable and maintainable.
This fixes a bug by the way: we had
void *callback(struct driveinfo *, struct part_entry *, int, int)
where we should have had
void (*callback)(struct driveinfo *, struct part_entry *, int, int)
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Thu, 6 Aug 2009 02:19:59 +0000 (19:19 -0700)]
hdt: Don't show partition header if not needed
Don't blindly print the partition header: check if we are able to iterate
through them first.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Wed, 5 Aug 2009 22:59:57 +0000 (15:59 -0700)]
hdt: Fix disk menu to use the new disklib interfaces
Adapt the disk menu to use the new disklib interfaces. This fixes bugs related
to the display of partition numbering and swsusp signature.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Wed, 5 Aug 2009 22:11:01 +0000 (15:11 -0700)]
hdt: Make the menu and cli use the new disk interfaces
The disklib interfaces have changed (errno_disk introduced). Update
these changes in hdt (nobody else use them).
Misc: fix get_error declaration.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Wed, 5 Aug 2009 22:09:47 +0000 (15:09 -0700)]
gpllib: More errno fixes
* Fix header files due to previous commit
* Prefix disk errnos with ED to avoid conflicts with classic errno
* Fix swsusp code to use errno_disk
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Wed, 5 Aug 2009 20:49:37 +0000 (13:49 -0700)]
gpllib: Enhance Makefile
Leverage Make built-ins rather than listing manually all objects files to
compile.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Wed, 5 Aug 2009 20:48:54 +0000 (13:48 -0700)]
gpllib: Fix compilation
ata.c was missing the inttypes.h header.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Wed, 5 Aug 2009 19:42:37 +0000 (12:42 -0700)]
disklib: Change read/write interface
Get rid of the error pointer and use a errno-like error reporting mechanism.
Intent is to make these more like the standard read/write system calls.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Wed, 5 Aug 2009 19:39:21 +0000 (12:39 -0700)]
disklib: Fix write_verify_sectors
Compare the entire chunk (all sectors), not only the first one.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Wed, 5 Aug 2009 03:23:16 +0000 (20:23 -0700)]
Merge commit 'hpa/master' into for-erwan
Conflicts:
com32/cmenu/libmenu/com32io.h
com32/gplinclude/dmi/dmi.h
com32/gplinclude/dmi/dmi_base_board.h
com32/gplinclude/dmi/dmi_memory.h
com32/gplinclude/dmi/dmi_system.h
com32/gpllib/dmi/dmi.c
com32/gpllib/dmi/dmi_memory.c
com32/include/sys/pci.h
com32/lib/pci/scan.c
com32/modules/Makefile
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Pierre-Alexandre Meyer [Wed, 5 Aug 2009 00:35:32 +0000 (17:35 -0700)]
gpllib: refactor partitions detection
Re-implement the logic to parse extended partitions to correctly go through the
linked list of partitions.
Updated the CLI in hdt and tested it both on Qemu (Debian Lenny installation)
and on DELL E6400 (6 partitions). The output seemed sane.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
H. Peter Anvin [Mon, 3 Aug 2009 21:14:40 +0000 (14:14 -0700)]
NEWS: document isohybrid -id fixed.
Steffen Winterfeldt [Mon, 3 Aug 2009 13:21:02 +0000 (15:21 +0200)]
isohybrid: convert -id to a binary string
Shouldn't 'isohybrid -id ID' write ID as 32bit number? Currently it ends up
as string messing up the mbr.
H. Peter Anvin [Sun, 2 Aug 2009 18:59:03 +0000 (11:59 -0700)]
memdisk: remove unnecessary %ifdef
Remove an %ifdef that the macros take care of anyway.
H. Peter Anvin [Sun, 2 Aug 2009 18:56:38 +0000 (11:56 -0700)]
memdisk: don't set CX:DX for INT 13h AH=15h for floppies
Win98SE DOS apparently hangs if INT 13h, AH=15h returns the capacity
in CX:DX for floppies... *unless* EDD is enabled. Confused yet?
This patch also adds some more tracing framework.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Miller, Shao [Sun, 2 Aug 2009 05:33:36 +0000 (01:33 -0400)]
MEMDISK: additional EDD DPT Fields
We incorrectly used "equ" instead of "dd" (or "db") for strings in
memdisk.inc. Oops! My mistake in my 'freedos' branch. Silly
mistake. - Shao
H. Peter Anvin [Fri, 31 Jul 2009 15:27:58 +0000 (08:27 -0700)]
memdisk: correct the types for the EDD DPT, and write a real one
Fix the sizes of some of the fields in the EDD DPT. Write a real one
to the best of our ability.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Fri, 31 Jul 2009 15:24:27 +0000 (08:24 -0700)]
memdisk: don't write the EDD DPT unless we are in EDD mode...
Don't write the EDD DPT unless we're actually in EDD mode! Otherwise
we end up corrupting memory beyond the defined code. This was the
reason
5ca2764460883f5e9a5bd83db00f242ea1272e33 worked, by moving
variables out of the corruption zone.
Debugged-by: Shao Miller <Shao.Miller@yrdsb.edu.on.ca>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Fri, 31 Jul 2009 05:40:06 +0000 (22:40 -0700)]
Merge commit 'andytim/freedos'
H. Peter Anvin [Fri, 31 Jul 2009 05:27:16 +0000 (22:27 -0700)]
graphics: actually do 32-bit writes to VGA
Use "rep movsd" to copy data to VGA memory, not "rep movsb".
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Shao Miller [Fri, 31 Jul 2009 05:27:05 +0000 (01:27 -0400)]
[memdisk] Additional EDD Device Parameter Table fields
Some additional fields from the EDD-4 spec. draft for the Device Parameter
Table have been added into the structure in setup.c and memdisk.inc. These
were added in the hopes of resolving a FreeDOS MEMDISK bug on IBM ThinkPads.
H. Peter Anvin [Fri, 31 Jul 2009 00:44:12 +0000 (17:44 -0700)]
graphics: trivial optimization of old-style graphic mode
Trivially optimize the old-style graphics by using another level of
temporary buffering in bitplane format, thereby enabling the use of
rep movsd to write the contents to the screen. This can speed things
up substantially in virtualization environments.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>