🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.asm
Article #1057

Własny program startowy

#1057
From: AdamW
Date: Fri, 20 Apr 2007 19:08
49 lines
2310 bytes
Witam, chciałem napisać w assemblerze własny program startowy do
komputera. Jedynym jego zadaniem jest wypisanie pewnego tekstu na
ekranie i pozostawienie komputera w stanie wlaczonym.  Przejrzalem
zrodla linuxowego kernela oraz lilo i wyskrobalem (wykopiowalem ;) )
cos takiego:
## CUT ###.
code16

.text

.global _start
_start:
 movb $0xe,%ah
 movw $0x7,%bx
 movw $msg,%si

msg_loop:
 lodsb
 cmpb $0,%al
 je loop
 int $0x10
 jmp msg_loop

loop:
 jmp loop

msg:
 .ascii "\n"
 .ascii "\n"
 .ascii "\n"
 .ascii "Tutaj moj tekst\n"
 .ascii "\n"
 .ascii "\n"
 .ascii "\n"
 .byte  0
## CUT ###
Tutaj jak sie z nim obchodze:
adam@localhost $ as -o bootsect.o bootsect.S
adam@localhost $ ld bootsect.o -o bootsect.bin --oformat binary -Ttext
1000
root@localhost # dd if=bootsect.bin of=/dev/hda bs=512 count=1
I potem reset, żeby przetestować.
Jak widac korzystam z 32-bitowego Intel-compatybile'nego procesora.
Jak to odpale to nic się nie dzieje, po prostu nic. Zachowany zostaje
stan sprzed uruchomienia (na ekranie), tak dlugo az go nie Ctrl-Alt-
Del albo nie zresetuje z guzika.
Oprócz tego jeszcze pytanko jak wyczyścić ekran wywołaniem do biosa?
Czy moze latwiej bedzie nadpisac go Newline'ami?
Pozdrawiam
Technical Details
Message-ID: <1177096138.997638.116250@b75g2000hsg.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!b75g2000hsg.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!b75g2000hsg.googlegroups.com!not-for-mail
From: AdamW <adam.wieckowski@gmail.com>
Newsgroups: pl.comp.lang.asm
Subject: Własny program startowy
Date: 20 Apr 2007 12:08:59 -0700
Organization: http://groups.google.com
Lines: 52
Message-ID: <1177096138.997638.116250@b75g2000hsg.googlegroups.com>
NNTP-Posting-Host: 83.168.75.14
Mime-Version: 1.0
X-Trace: posting.google.com 1177096139 2738 127.0.0.1 (20 Apr 2007 19:08:59 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 20 Apr 2007 19:08:59 +0000 (UTC)
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1.3) Gecko/20070404 Firefox/2.0.0.3,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: b75g2000hsg.googlegroups.com; posting-host=83.168.75.14;   posting-account=XJE0zA0AAABpHnPDh4hDbKe72S3LO8i0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit