{"id":6062,"date":"2026-06-24T18:53:06","date_gmt":"2026-06-24T09:53:06","guid":{"rendered":"https:\/\/www.freelifemakers.org\/wordpress\/?p=6062"},"modified":"2026-06-24T19:07:19","modified_gmt":"2026-06-24T10:07:19","slug":"os-minios-3-2","status":"publish","type":"post","link":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2026\/06\/24\/os-minios-3-2\/","title":{"rendered":"[OS]miniOS-3(2)"},"content":{"rendered":"\n<p>\u2714\ufe0f sector2.asm<\/p>\n\n\n\n<p>&#8212; \ub450\ubc88\uc9f8 \uc139\ud130 \/ Second sector<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;org 0x8000]<\/code><\/pre>\n\n\n\n<p>1)\ucef4\ud30c\uc77c\ub7ec\ub294 \uc774 \uac12\uc744 \uae30\uc900\uc73c\ub85c \ubaa8\ub4e0 \ubb38\uc790\uc5f4 \uc8fc\uc18c(\uc608: msg_next_sector)\uc758 \uc704\uce58\ub97c \uacc4\uc0b0\ud569\ub2c8\ub2e4.<br>The compiler calculates the locations of all string addresses (e.g., msg_next_sector) based on this value.<\/p>\n\n\n\n<p>2)PC\uac00 \ucc98\uc74c \ubd80\ud305\ub418\uc5c8\uc744 \ub54c, 16\ube44\ud2b8 \ub9ac\uc5bc \ubaa8\ub4dc\uc5d0\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uae30\ubcf8 \uba54\ubaa8\ub9ac \ub9f5(\uc57d 640KB) \uc911 \uc0ac\uc6a9\uc790\uac00 \ub9c8\uc74c\ub300\ub85c \uc4f8 \uc218 \uc788\ub294 \uc548\uc804\ud55c \uad6c\uac04\uc774 \uc874\uc7ac\ud569\ub2c8\ub2e4.<br>When a PC first boots up, there is a safe region within the base memory map (approximately 640 KB) available in 16-bit real mode that the user can utilize freely.<\/p>\n\n\n\n<p>3)\uadf8\ub798\uc11c \uc8fc\uc18c\ub97c 0x9000\uc73c\ub85c \ubc14\uafc0 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br>So, you can change the address to 0x9000.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>0x0000 ~ 0x04FF: \nBIOS \uc778\ud130\ub7fd\ud2b8 \ubca1\ud130 \ud14c\uc774\ube14, BIOS \ub370\uc774\ud130 \uc601\uc5ed (\uc808\ub300 \uac74\ub4dc\ub9ac\uba74 \uc548 \ub428)\nBIOS Interrupt Vector Table, BIOS Data Area (must absolutely not be touched)\n\n0x7C00 ~ 0x7DFF: \nMBR \ucf54\ub4dc\uac00 \ub85c\ub4dc\ub418\ub294 \uc601\uc5ed (512\ubc14\uc774\ud2b8)\nThe area where the MBR code is loaded (512 bytes)\n\n0x7E00 ~ 0x9FFFF: \n\ube44\uc5b4 \uc788\ub294 \uc77c\ubc18 \uba54\ubaa8\ub9ac \uc601\uc5ed (\uc790\uc720\ub86d\uac8c \uc0ac\uc6a9 \uac00\ub2a5)\nUnused general memory area (available for free use)<\/code><\/pre>\n\n\n\n<p>&#8212; 16\ube44\ud2b8 \ub9ac\uc5bc\ubaa8\ub4dc \/ 16bit real mode<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bits 16<\/code><\/pre>\n\n\n\n<p>&#8212; mov si, msg_boot \uc5ec\uae30 si\ub808\uc9c0\uc2a4\ud130\uc5d0 msg_next_sector\uc5d0 \uc800\uc7a5\ub41c \uac12\uc758 \uc8fc\uc18c\ub97c \uc800\uc7a5\ud569\ub2c8\ub2e4.<br><code>mov si, msg_boot<\/code>: This stores the address of the value held in <code>msg_next_sector<\/code> into the <code>si<\/code> register.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mov si, msg_next_sector<\/code><\/pre>\n\n\n\n<p>&#8212; print_string\ub77c\ubca8 \ud568\uc218 \ud638\ucd9c\uc785\ub2c8\ub2e4.<br>This is a call to the print_string_label function.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>call print_string<\/code><\/pre>\n\n\n\n<p>&#8212; \ub300\uae30\ubaa8\ub4dc\uc785\ub2c8\ub2e4.(\uc790\uae30 \uc790\uc2e0\uc758 \uc704\uce58\ub85c \uc810\ud504\ud569\ub2c8\ub2e4.)<br>It is in standby mode. (It jumps to its own position.)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>jmp $<\/code><\/pre>\n\n\n\n<p>&#8212; \uba54\ubaa8\ub9ac\uc5d0 \uc800\uc7a5\ub41c \ubb38\uc790\uc5f4\uc744 \ud55c \uae00\uc790\uc529 \uc77d\uc5b4\uc11c, \ud654\uba74\uc5d0 \uc5f0\uc18d\uc73c\ub85c \ucd9c\ub825\ud558\ub294 \ud568\uc218\uc785\ub2c8\ub2e4.<br>This function reads a string stored in memory character by character and outputs it to the screen continuously.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>print_string:\n    lodsb\n    cmp al, 0\n    je .done\n    mov ah, 0x0e\n    int 0x10\n    jmp print_string\n.done:\n    ret<\/code><\/pre>\n\n\n\n<p>&#8212; \ubcc0\uc218\ub97c \uc120\uc5b8\ubd80\ubd84\uc785\ub2c8\ub2e4.<br>This is the section where variables are declared.<\/p>\n\n\n\n<p>1)\uac01 \ubcc0\uc218\uc5d0 \ubb38\uc790\ub97c 1\ubc14\uc774\ud2b8\uc529 \uc800\uc7a5\ud569\ub2c8\ub2e4.<br>Store one byte of character data in each variable.<\/p>\n\n\n\n<p>2)13\uc740 \uce90\ub9ac\uc9c0 \ub9ac\ud134(\\r)\uc73c\ub85c \ucee4\uc11c\ub97c \ud604\uc7ac \uc904\uc758 \ub9e8 \uc67c\ucabd(\uccab \ubc88\uc9f8 \uce78)\uc73c\ub85c \uc774\ub3d9\uc2dc\ud0b5\ub2c8\ub2e4.<br>13 is the carriage return (\\r), which moves the cursor to the far left (the first column) of the current line.<\/p>\n\n\n\n<p>3)10 \ub77c\uc778 \ud53c\ub4dc(\\n)\ub85c \ucee4\uc11c\ub97c \ud604\uc7ac \uc704\uce58\uc5d0\uc11c \uc815\ud655\ud788 \ud55c \uc904 \uc544\ub798\ub85c \ub0b4\ub9bd\ub2c8\ub2e4.<br>10 Moves the cursor exactly one line down from its current position using a line feed (\\n).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>msg_next_sector db '3. Hello from Sector 2 (0x8000)!', 13, 10, 0<\/code><\/pre>\n\n\n\n<p>&#8212; \uacc4\uc0b0\ub41c \ud69f\uc218\ub9cc\ud07c \ubc14\uc774\ud2b8(db) \uacf5\uac04\uc744 \uc804\ubd80 0\uc73c\ub85c \ucc44\uc6b0\ub77c\ub294 \uba85\ub839\uc5b4\uc785\ub2c8\ub2e4.<br>This command fills the specified number of bytes (db) with zeros.<\/p>\n\n\n\n<p>1)\ubd80\ud305\ud310\ubcc4\uc744 \uc704\ud55c \uc2dc\uadf8\ub2c8\ucc98\uac00 \ud544\uc694 \uc5c6\uae30 \ub54c\ubb38\uc5d0 512\uc785\ub2c8\ub2e4.<br>It is 512 because no signature is required to determine the boot status.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>times 512 - ($ - $$) db 0<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u2714\ufe0f sector2.asm &#8212; \ub450\ubc88\uc9f8 \uc139\ud130 \/ Second sector 1)\ucef4\ud30c\uc77c\ub7ec\ub294 \uc774 \uac12\uc744 \uae30\uc900\uc73c\ub85c \ubaa8\ub4e0 \ubb38\uc790\uc5f4 \uc8fc\uc18c(\uc608: msg_next_sector)\uc758 \uc704\uce58\ub97c \uacc4\uc0b0\ud569\ub2c8\ub2e4.The compiler calculates the locations of all string addresses (e.g., msg_next_sector) based on this value. 2)PC\uac00 \ucc98\uc74c \ubd80\ud305\ub418\uc5c8\uc744 \ub54c, 16\ube44\ud2b8 \ub9ac\uc5bc \ubaa8\ub4dc\uc5d0\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uae30\ubcf8 \uba54\ubaa8\ub9ac \ub9f5(\uc57d 640KB) \uc911 \uc0ac\uc6a9\uc790\uac00 \ub9c8\uc74c\ub300\ub85c \uc4f8 \uc218 \uc788\ub294 \uc548\uc804\ud55c \uad6c\uac04\uc774 \uc874\uc7ac\ud569\ub2c8\ub2e4.When [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,1],"tags":[],"class_list":["post-6062","post","type-post","status-publish","format-standard","hentry","category-os","category-uncategorized","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/6062","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=6062"}],"version-history":[{"count":2,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/6062\/revisions"}],"predecessor-version":[{"id":6065,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/6062\/revisions\/6065"}],"wp:attachment":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=6062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=6062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=6062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}