![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-25 19:55 |
47,812 topics / 349,910 posts / today 0 new / 48,263 members |
| DOS启动盘 & LOGO技术 (启动盘室) » Can make your self-written program be started by the bootloader (with source code) |
| Printable Version 7,232 / 23 |
| Floor1 taowentao | Posted 2005-08-26 11:49 |
| 高级用户 Posts 111 Credits 739 From 辽宁沈阳 | |
|
cstrt086.asm is my modification of the startup file of Open Watcom C/C++ 1.3, making the startup address of the program cstart become 0000:0000, which makes it easier to relocate the program. In this way, the executable image file can be generated by EXEFLAT.EXE (only for 16-bit DOS real mode);
sys_demo.bat is a batch file that turns demo.exe into KERNEL.SYS that can be booted from the hard disk by FreeDOS boot loader; Set the starting address in Open Watcom C/C++ 1.3 link switches --> 3. Advanced switches to _cstart_, compile MAIN_boot.c and cstrt086.asm, name the executable file demo.exe, double-click (execute) sys_demo.bat; you can get KERNEL.SYS; Replace KERNEL.SYS with FreeDOS's KERNEL.SYS (you can rename FreeDOS's KERNEL.SYS) to realize the hard disk boot of FreeDOS boot loader; Extract the files in rtCell_img.rar and Qemu.rar to the same folder (without any subdirectories), double-click (execute) rtCell.bat to see that KERNEL.SYS is loaded by FreeDOS boot loader and executed on the emulator; ***************************************************** ***This file is best executed with a virtual machine or emulator to avoid damaging hard disk data*** ***************************************************** If any friend has questions, new ideas, or finds errors, please contact: taowentao_twt@163.com [ Last edited by taowentao on 2005-9-3 at 15:53 ] |
|
| Floor2 taowentao | Posted 2005-08-28 13:30 |
| 高级用户 Posts 111 Credits 739 From 辽宁沈阳 | |
|
"China DOS Union Forum » DOS Development Programming & Development Exchange (Development Room) ---> Real-time microkernel that can read and write FAT16 format files on the hard disk" There are also files related to reading and writing FAT16 format files on the hard disk that can be downloaded.
Among them, the C code for reading and writing the hard disk is only more than 400 lines; The C code for reading and writing FAT16 format files is only more than 620 lines. Very suitable for writing your own boot programs or for embedded systems. |
|
| Floor3 TurboY | Posted 2005-08-29 01:02 |
| 中级用户 Posts 99 Credits 322 From 湖北 | |
|
I still can't understand these programs now, but I admire that you understand the operating system so thoroughly!
|
|
| Floor4 fdsiuha | Posted 2005-08-29 15:47 |
| 高级用户 Posts 302 Credits 587 | |
|
How to obtain the source code of FREEDOS32? The website says that it is necessary to use a certain synchronization download tool, but I have tried several times without success.
|
|
| Floor5 taowentao | Posted 2005-08-29 16:06 |
| 高级用户 Posts 111 Credits 739 From 辽宁沈阳 | |
|
I tried, and I can download directly
"http://prdownloads.sourceforge.net/freedos-32/fd32-0.0.5-src.tar.bz2?use_mirror=umn" |
|
| Floor6 fdsiuha | Posted 2005-08-29 20:39 |
| 高级用户 Posts 302 Credits 587 | |
|
I'm really dizzy. (Sweat...)
I only focused on the "Latest source code from CVS"... |
|
| Floor7 taowentao | Posted 2005-08-31 09:18 |
| 高级用户 Posts 111 Credits 739 From 辽宁沈阳 | |
|
Both rtCell_img.rar and Qemu.rar should be downloaded simultaneously and extracted into the same folder (without any subdirectories) to see the execution result on the emulator. To make your self-compiled program be booted by the bootloader and executed correctly, there should be no DOS calls in this program; it can only call BIOS functions or your self-compiled hardware driver programs. There are many resources available online for reference, please friends query them.
|
|
| Floor8 taowentao | Posted 2005-09-02 09:33 |
| 高级用户 Posts 111 Credits 739 From 辽宁沈阳 | |
|
The rtCell.img in rtCell_img.rar is a hard disk image file. You can use winimage to add or delete files/folders in it (winimage can be downloaded from http://as.onlinedown.net/). So as to demonstrate the program you wrote that is started by the "bootloader" on the emulator.
|
|
| Floor9 taowentao | Posted 2005-09-07 15:21 |
| 高级用户 Posts 111 Credits 739 From 辽宁沈阳 | |
|
Make the following modifications to the file:
public _arg1 public _arg2 . . . _cstart_ proc near jmp around _arg1: DB 'a', 'r', 'g', '1' _arg2: DB 'a', 'r', 'g', '2' around: sti ; enable interrupts mov dx,DGROUP mov ds,dx mov es,dx call _CMain _cstart_ endp Then reference in the C program: extern DWORD arg1, arg2; Modify the values of arg1 and arg2 in the executable file from the bootloader (dynamically) or using a binary modification tool (static), so that parameters can be passed to your program. |
|
| Floor10 taowentao | Posted 2005-09-14 11:34 |
| 高级用户 Posts 111 Credits 739 From 辽宁沈阳 | |
|
Off-the-BIOS FAT16 file operations, please go to
"DOS Development Programming & Development Exchange (Development Room) ------> Read-write hard disk FAT16 format file real-time microkernel (including source code)" to view the source code. |
|
| Floor11 liangshenda | Posted 2006-02-04 14:40 |
| 新手上路 Posts 6 Credits 8 | |
| Floor12 hnlyzhd | Posted 2006-02-05 22:41 |
| 高级用户 Posts 164 Credits 544 | |
|
I will provide a file:
This is a protection module of a hard disk protection card, write hj.bin into the BIOS chip of the mainboard. Plug in the network card to replace the hard disk protection card. Hope you can write a program to load and run it under DOS, or make it into KERNEL.SYS like the program you posted on the DOS forum to start and test its performance! [ Last edited by hnlyzhd on 2006-2-5 at 22:48 ] Attachments bin.rar (50.02 KiB) |
|
| Floor13 taowentao | Posted 2006-02-09 12:46 |
| 高级用户 Posts 111 Credits 739 From 辽宁沈阳 | |
|
Please provide the relevant Chinese content about "hj.bin 的调用接口作个详细说明,列出其初始化入口地址" so that I can translate it. Currently, the content you provided is incomplete for translation. Please supply the full relevant Chinese text.
|
|
| Floor14 crackle | Posted 2006-10-20 15:14 |
| 新手上路 Posts 7 Credits 14 | |
|
Too profound!! Can't understand
|
|
| Floor15 electronixtar | Posted 2006-10-20 21:52 |
| 铂金会员 Posts 2,672 Credits 7,493 | |
|
The foundation is not enough~~~ Too advanced~~~
|
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |