Re: [Freedos-devel] If I want to compile applications in FreeDOS, which compiler should I use?

2011-09-04 Thread Decheng Fan
On Mon, Aug 22, 2011 at 1:21 AM, Eric Auer e.a...@jpberlin.de wrote:


 Hi Robbie / Decheng,

  don't know what's the standard (or recommended) development environment
  to develop applications in FreeDOS. Would you please let me know?

 That depends on what sorts of applications you want to write.
 OpenWatcom is certainly a nice choice for C / C++, as ist NASM
 for Assembly language. You can also use JWASM which has more of
 the MASM look and feel. If you like GNU C (GCC / G++) then you
 should have a look at DJGPP which is GNU C / C++ for DOS with a
 complete C library which makes the whole DOS feel a lot like a
 normal GNU / POSIX OS such as Linux compared to classics like
 Borland C which have a lot of DOS in their DOS environment :-)

 I do know that DJGPP also has some common(?) IDEs and that some
 bigger editors also try to be universal IDEs, but I cannot say
 what the typical preferred IDE for OpenWatcom is at the moment.

  I've checked out the subversion repository of FreeDOS...

 This only shows you the kernel and the command.com and some
 small tools like SYS and MEM. In a way, the SVN of FreeDOS
 is more like a kernel.org repository. You probably want to
 look at the gnu.org repository equivalent of all those user
 land tools which make FreeDOS a complete operating system.

 Because FreeDOS does not have such a central repository, a
 lot like in Linux land where most of the software also has
 individual pages instead of being bundled on gnu.org, you
 would not do this using SVN. Instead, you can check the DOS
 software list on www.freedos.org/software/ and visit those
 pages that are interesting for you. Also, FreeDOS maintains
 a big collection of zipped up tools and their sources on
 ibiblio. It is just that those are not the place where the
 tools are developed, FreeDOS just stores and mirrors them.

  freecom - from the trunk directory it seems it contains the FreeCom
 shell,
  kernel - from trunk directory it seems it contains the kernel source
 code,
  mem - from the trunk directory it seems it contains mem.exe source code?

 Exactly.

  BTW, my point of interest is in the kernel part and also utility
  applications. As I've always been developing user-mode applications since
  I've learned programming 15 years ago, to develop the kernel it would
 take
  some time for me to start. To learn about the kernel, I'd also like to
 know
  how to compile the kernel, e.g. which compiler is the standard or...

 The kernel is on one hand a bit like a C library - it provides a
 number of utility functions for DOS apps and those functions are
 written just in C as any other library would be... On the other
 hand, like all kernels, parts of the FreeDOS kernel have to deal
 with evil and obscure low level management of hardware, RAM etc.
 Lucklily the BIOS is called for some of this and even much of the
 low level stuff is written in easier to understand C. Still the
 kernel (as FreeCOM, for other reasons) has different memory layout
 and management than you might be used to from user applications.

 To compile the kernel, you use OpenWatcom C, NASM Assembler and
 FreeCOM and UPX as shell in DOS and for compression. Because all
 tools exist for Linux, cross-compiling is also supported. Then
 you do not need FreeCOM, of course.

  do you have any suggestions on how to test/debug the kernel?

 Depends on how badly you want to break it ;-) You can test many
 things in DOSEMU which runs on your real CPU but simulates most
 other hardware in Linux. It also has a built-in debugger which
 runs in another window. More low level is using Bochs or other
 complete virtual PC systems. For example Bochs also has a nice
 built-in debugger. However, I would only go THAT virtual when I
 want to play with a very lowlevel kernel feature or driver such
 as a clone of EMM386. For all smaller kernel activities, you can
 even just boot the kernel on real hardware and add some debugger
 messages here and there or use good old DEBUG to inspect, maybe
 edit, memory contents. In the normal worst case, you just have
 to press reset to boot a fresh DOS in a few seconds. There is a
 number of boot menus (eg metaboot is a simple one) which let you
 pick one of multiple kernels at boot, so you can combine stable
 and experimental kernels on one drive. Of course the extreme
 worst case can, as with any kernel, mess up your disk contents,
 or in theory even damage hardware, but as said, there is Bochs.

  A short introduction of myself: I graduated from Shanghai Jiao Tong
  University computer science as a bachelor in 2004, and got a master of
  engineering degree from SJTU in 2009 (in computer technology). I've
 worked
  on C/C++ programming on the Windows platform, C#/ASP.NET/Windows Forms,
 also
  some C++/CLI; I've self-studied MS-DOS, QBASIC, JavaScript/CSS/HTML. I've

 You have a lot of MS experience then... Honestly, I never found MSVC
 very debugging-friendly... As for QBASIC, the Freebasic compiler has
 a command line option 

Re: [Freedos-devel] ANSI C (C89) locale.h -- DOS compiler support?

2011-09-04 Thread Decheng Fan
On Sun, Sep 4, 2011 at 3:25 AM, Rugxulo rugx...@gmail.com wrote:

 Hi guys,
   Just curious, does anybody know of a C compiler that actually
 supports a *functional* locale.h ?? It doesn't seem like most (if any)
 barely support it, if at all. Kinda strange since it's a requirement
 for ANSI C (1989), esp. since the DOS support is presumably there
 (COUNTRY.SYS + NLSFUNC). It just seems weird to be missing pretty much
 everywhere. (I don't expect full C94 / NA1 's wchar_t, wcs*, etc.,
 just wondering why it's not more widely supported in DOS.)


 --
 Special Offer -- Download ArcSight Logger for FREE!
 Finally, a world-class log management solution at an even better
 price-free! And you'll get a free Love Thy Logs t-shirt when you
 download Logger. Secure your free ArcSight Logger TODAY!
 http://p.sf.net/sfu/arcsisghtdev2dev
 ___
 Freedos-devel mailing list
 Freedos-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/freedos-devel


Hi Rugxulo,

It sounds interesting. Multi-lingual support provided by the OS platform was
really something that I have used on Windows and Linux, but I never used it
on MS-DOS or FreeDOS. I knew there are country.sys in MS-DOS and code page
support (even there is a Simplified Chinese version of MS-DOS 6.22), but I
don't know how to use them in programs. Is locale.h functional in Microsoft
compilers?

Best regards,

Robbie (Decheng) Fan
--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] If I want to compile applications in FreeDOS, which compiler should I use?

2011-09-04 Thread Bernd Blaauw
Op 4-9-2011 13:06, Decheng Fan schreef:

 I've also compiled FreeCOM, but there seems to be some warning messages,
 although I still get the final COMMAND.COM http://command.com/ file.
 The warning messages read like following:
 C:\WATCOM\BINNT\wcc -zq kswap.c -bt=dos @watcomc.cfg
 kswap.c(160): Warning! W102: Type mismatch (warning)
 kswap.c(160): Note! N2003: source conversion type is 'struct __iobuf *'
 kswap.c(160): Note! N2004: target conversion type is 'unsigned int '
 ...
 C:\Nasm209\nasm.exe  -f bin -o vspawn.com http://vspawn.com/  vspawn.asm
 vspawn.asm:342: warning: label alone on a line without a colon might be
 in error
 vspawn.asm:388: warning: label alone on a line without a colon might be
 in error

These are 8086-specific disk-swapping helpers, so you can run a program 
while storing part of FreeCOM's memory on disk. Thus, they're optional.

 After compiling the kernel, I got KWC8616.sys as the kernel.sys file.
 Does this file name mean a kernel that runs on 8086, which supports
 FAT12/FAT16 (and because 80286/80386 is backwards compatible with 8086,
 so this kernel also runs on them?)

A '86' runs on 8086 and above, thus most generic/universal. Ending up 
with a '16' means support for FAT12 and FAT16 only, thus no FAT32. Most 
universal is a KWC8632.SYS renamed to KERNEL.SYS. Most MSDOS (1.00-7.00) 
compatible is a KWC8616 (with version set to 5.00 or 6.22).

 If I want to debug the kernel, say, the boot process, I guess I need to
 use bochs for that purpose?

or QEMU. Both have great logging/debugging ability, though I've not used 
that myself.

 And for device drivers is DOSEMU better for that purpose?

No idea. I know Japheth added some config.sys version to the DEBUG 1.25 
program..somewhere.


 My next step would be to understand the boot process as a whole.

Kernel sourcecode would be best studied. Remember you've got a hardware 
boot routine (on x86 it's mostly BIOS, sometimes EFI with or without 
BIOS compatibility), accessing a disk and then is the DOS bootup (disk 
-- MBR -- partition -- bootsector -- kernel -- magic (memory setup, 
disk enumeration) -- config.sys processing -- driver loading -- shell 
loading -- init script -- more driver loading -- console ( stare at 
C:\_ )

 Thanks and best regards,

 Robbie (Decheng) Fan

Have fun

--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] If I want to compile applications in FreeDOS, which compiler should I use?

2011-09-04 Thread dos386
 And for device drivers is DOSEMU better for that purpose?

I doubt that. Rather BOCHS, if it emulates the device you are
interested in (PCI bridge in BOCHS is a dream so far) ...
debugging drivers is always hard :-(

 No idea. I know Japheth added some config.sys version
 to the DEBUG 1.25 program..somewhere.

There is support for a DOS SYS (instead of DOS COM) DEBUG
in the source, so you must compile it yourself using JAWASM
(works for me) and then you can load this DEBUG from
FDCONFIG.SYS and use it to debug other SYS modules (untested).

Anyway, why not code drivers as TSR's rather than DOS SYS ?

 Of course you can
 use JavaScript or CSS in your HTML with a DOS server, but BROWSERS
 for DOS will often ignore them and just look at the plain HTML. You
 might be interested to play with projects which work to change that.

Arachne is now abandoned and needs a new maintainer.
CSS support is limited and no JS.

--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] Freedos and lack of drivers

2011-09-04 Thread dos386
 It's possible make a stubbing for use WIN drivers under
 freedos (maybe with HX EXTENDER?)

Theoretically possible, but extremely difficult.

--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] ANSI C (C89) locale.h -- DOS compiler support?

2011-09-04 Thread Rugxulo
Hi,

On Sun, Sep 4, 2011 at 6:13 AM, Decheng Fan fandech...@gmail.com wrote:
 On Sun, Sep 4, 2011 at 3:25 AM, Rugxulo rugx...@gmail.com wrote:

 Hi guys,
   Just curious, does anybody know of a C compiler that actually
 supports a *functional* locale.h ?? It doesn't seem like most (if any)
 barely support it, if at all. Kinda strange since it's a requirement
 for ANSI C (1989), esp. since the DOS support is presumably there
 (COUNTRY.SYS + NLSFUNC). It just seems weird to be missing pretty much
 everywhere. (I don't expect full C94 / NA1 's wchar_t, wcs*, etc.,
 just wondering why it's not more widely supported in DOS.)

 Hi Rugxulo,

 It sounds interesting. Multi-lingual support provided by the OS platform was
 really something that I have used on Windows and Linux, but I never used it
 on MS-DOS or FreeDOS. I knew there are country.sys in MS-DOS and code page
 support (even there is a Simplified Chinese version of MS-DOS 6.22), but I
 don't know how to use them in programs. Is locale.h functional in Microsoft
 compilers?

I don't have any MS compilers, that's why I ask. And I personally
doubt it, esp. considering how lame even WinME codepage support was.
(Thanks to people like Henrique and Eduardo, FreeDOS has very good
codepage + country coverage.)

C89 seemed to require 15 headers, and locale.h was one, but almost all
DOS compilers I have don't include it (or even for the handful that
did, a wimpy test didn't indicate it to actually work). Which sucks.

I'm on a different computer right now, but I'm pretty sure only three
compilers had locale.h (if I'm remembering correctly). There may be
more, but I haven't got access to (nor ever used) them nowadays.

CC386 apparently has some rough support for en_EN, en_GB, fr_FR,
and that's all I think (though I don't know how to activate it
properly). I'm not sure what that entails.

OpenWatcom has locale.h, but its headers are just confusing (thanks to
supporting a billion OSes), so I have no idea if it's just empty stubs
for DOS (probably) vs. works fine on Windows. (To most people,
supporting cp850 was exotic enough, I guess.) They did used to have
Japanese error messages for the compiler proper, but that's not the
same as setlocale() and lconv-currency_symbol, etc. (Though their
included vi clone was made 8-bit clean in latest release, I think, but
I haven't tested.)

DJGPP (GCC) you'd think would be the best. But I'm 99% sure they never
bothered with multi-byte. At least, last I heard they only officially
supported the default C locale. I know there were some third-party
efforts. A quick check shows that Mark E. (Elbrecht?) did some
incomplete wchar.h work (stubs only??) that was probably never patched
in. Also Jack (Daisuke Aoyama) did some rough port of Bash 1.14.7
back in 1997 that supported Shift-JIS via two add-on libs. Also, CWS
at one time wanted to support iconv.dxe, but I guess they never
finished that (nor even 2.04 beyond beta status). There is a
lloc*.zip file (only) in /current/v2tk/ or such, liblocale I think,
and that (IIRC) basically patches some internal stuff to support
COUNTRY.SYS, but I've never tested it very well.

Long story short: I'm just curious. I would honestly be surprised if
*nobody* supported it. Yeah, I have to admit, I don't need it. Heck,
my alt-lang (E-o) doesn't even have a country (or support, obviously,
heh) though it has a codepage.   ;-)I hate to admit, but it's
probably due to U.S. apathy since everything here is English only.
Which sucks.

But since we've discussed i18n on FreeDOS several times over the past
few months, I figured I'd mention it (locale.h) in case anybody knew
offhand. I know various FD tools support COUNTRY.SYS and codepages,
but I was more curious if any DOS C compiler (since C is everywhere)
did, esp. re: ANSI C89, which mandated it.

--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] ANSI C (C89) locale.h -- DOS compiler support?

2011-09-04 Thread Steve Nickolas
On Sun, 4 Sep 2011, Rugxulo wrote:

 OpenWatcom has locale.h, but its headers are just confusing (thanks to
 supporting a billion OSes), so I have no idea if it's just empty stubs
 for DOS (probably) vs. works fine on Windows. (To most people,
 supporting cp850 was exotic enough, I guess.) They did used to have
 Japanese error messages for the compiler proper, but that's not the
 same as setlocale() and lconv-currency_symbol, etc. (Though their
 included vi clone was made 8-bit clean in latest release, I think, but
 I haven't tested.)

Heh.  I had some UTF-8 translation stuff in my IRC client for DOS, but it 
was all hardwired (though supported 3 codepages - 437, 850 and 852).  I 
bet the majority of apps simply assumed 437 (or maybe the 437/850 subset).

-uso.

--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel