Let $N$ be a positive integer. Denote by $\varepsilon(N)$ to be the number of fundamental units which appear for some real quadratic field. The goal is to prove that $\varepsilon(N)$ is asymptotic to $2N$.
Here is an incomplete argument that I have thus far.
If $\varepsilon$ is a fundamental unit of $L = \mathbb{Q}(\sqrt{d})$ where $d>1$ and square-free then $\varepsilon = a + b \sqrt{d}$ where $a,b$ are positive integers or positive half-integers (depending on $d$). If also require that $1 \leq \varepsilon \leq N$ then we see that $a\leq N$. It follows from here $\text{tr}_{L/\mathbb{Q}}(\varepsilon) = 2a$ and $N_{L/\mathbb{Q}}(\varepsilon) = \pm 1$. Thus, the minimal polynomial for $\varepsilon$ is given by $X^2 - cX \pm 1$ where $1\leq c \leq 2N$.
The larger root of this minimal polynomial is given by $c + \sqrt{c^2 \pm 4}$. If $c > N+1$ then this larger root is $>N$ and falls outside the allowable interval. Thus, we conclude that the fundamental units in the interval $[1,N]$ have minimal polynomial given by $X^2 - cX \pm 1$ where $1\leq c\leq N+1$.
We have a total of $2(N+1)$ such polynomials. The fundamental unit will be the larger root (by definition of fundamental unit in a real quadratic field). Thus, we have at most $2(N+1)$ such roots in the interval $[1,N]$. Of course, some of those roots might be units which are not fundamental, however, this is just an upper bound, and so we have, $$ \varepsilon(N) \leq 2(N+1) $$
Now we need some lower bound estimate. I have been trying to do several attempts but they are not working out so far. My intuition tells me the lower bound estimate should look something like $2N - \sqrt{N}$. But I cannot find any argument for that as I do not see how one can tell if such a polynomial has a fundamental unit as its root.
I was trying to estimate those $c$ for which $c^2 \pm 4$ is square-free. Those such $c$ will definitely lead to polynomials which have a root as a fundamental unit. But it is not clear to me how to estimate that quantity.