2个问题,BIOS例程和LibC [英] 2 Questions, BIOS Routine and LibC

查看:88
本文介绍了2个问题,BIOS例程和LibC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在这里有两个问题,(抱歉在一篇文章中发表了2个问题)

1)是否有一个BIOS例程可以从以下URL访问文件:www.domainname.tld /file.format

2)这个用于从汇编指令中创建C库,例如:

So I have 2 questions here, (Sorry for posting 2 questions in one Article)
1) Is there a BIOS routine that can receive a file from a URL like : www.domainname.tld/file.format
2)This one is for a creating a C Library out of assembly instructions like :

;===============Assembly Print Function====================
print_string:			; Routine: output string in SI to screen
	mov ah, 0Eh		; int 10h 'print char' function

.repeat:
	lodsb			; Get character from string
	cmp al, 0
	je .done		; If char is zero, end of string
	int 10h			; Otherwise, print it
	jmp .repeat

.done:
	ret



到此:


to this :

#include <libc.h> //Name of a header file
int main(void)
{
  printf("Hello World") //This is the print_string function before shown
}





任何帮助将不胜感激,

~ Sids123



Any help would be appreciated,
~Sids123

推荐答案

1。一些BIOS有一些扩展,但我不知道任何标准的BIOS功能,这些功能如此高级别的东西,如TCP连接到一个站点和下载文件与HTTP协议...在我看来PC应该支持用户友好的网络安装(如MACs)但是我们必须等待...我只想打开我的新空PC并希望能够选择/购买我选择的操作系统,通过几个按钮按下可选的自定义设置(如分区)。



2.一旦我在汇编中创建了部分printf实现,就输出格式化文本,以便用我的PRINTF汇编宏进行调试。这只是部分实现,只支持一些格式参数的部分实现。实现这样的功能很难实现,许多C库函数也是如此。如果你这样做是为了学习,那么继续这个,但是在C中编写这样的lib非常实用,因为它更容易这样做,更不用说错误,更容易调试/修复/理解,便携,...通常更好地使用尽可能最小的平台特定组件(看一下linux内核)因为写C不太痛苦而且C是可移植的。



我看到你的因为我在集会中有自己的根基,而且一旦我对集会中的世界进行重写充满了热情,但几年后我发现,在装配中写一切都是一个坏主意,原因很多。仍然很高兴知道组装和它是一个很好的方式来消磨一些时间。在Windows中调试C / C ++代码时,Asm知识非常方便。
1. Some BIOSes have some extensions but I don't know about any standard bios functions that do so high level stuff like connecting with TCP to a site and downloading file with HTTP protocol... In my opinion PCs should support user friendly network installs (like MACs) but we have to wait with that... I just want to turn on my new empty PC and I want to be able to select/buy an OS of my choice that gets installed with a few button presses with optional customizations (like partitioning).

2. Once I've created a partial printf implementation in assembly to output formatted text for debugging with my PRINTF assembly macro. It was just a partial implementation by supporting only a few formats with partial implementation of formatting parameters. Its a pain in the ass to implement such a function and the same is true for a lot of C library functions. If you are doing this for learning then go ahead with this but its much practical to write such a lib in C because its much easier to do so, much less buggy, easier to debug/fix/understand, portable,... Its usually better to use as minimal platform specific assembly as possible (take a look at the linux kernel) because writing C is much less painful and C is portable.

I see your point because I have my roots in assembly and once I was full of enthusiasm to rewrite the world in assembly but I've found out after a few years that writing everything in assembly is a bad idea for many reasons. Still its good to know assembly and its a nice way to kill some time. Asm knowledge comes very handy sometimes when debugging C/C++ code in windows.


这篇关于2个问题,BIOS例程和LibC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆